home *** CD-ROM | disk | FTP | other *** search
/ Games of Daze / Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso / djgpp / src / gdb-4.12 / gdb / ch-exp-t.c < prev    next >
Encoding:
C/C++ Source or Header  |  1994-02-03  |  71.2 KB  |  2,785 lines

  1.  
  2. # line 55 "./ch-exp.y"
  3.  
  4. #include "defs.h"
  5. #include <ctype.h>
  6. #include "expression.h"
  7. #include "language.h"
  8. #include "value.h"
  9. #include "parser-defs.h"
  10. #include "ch-lang.h"
  11. #include "bfd.h" /* Required by objfiles.h.  */
  12. #include "symfile.h" /* Required by objfiles.h.  */
  13. #include "objfiles.h" /* For have_full_symbols and have_partial_symbols */
  14.  
  15. /* Remap normal yacc parser interface names (yyparse, yylex, yyerror, etc),
  16.    as well as gratuitiously global symbol names, so we can have multiple
  17.    yacc generated parsers in gdb.  Note that these are only the variables
  18.    produced by yacc.  If other parser generators (bison, byacc, etc) produce
  19.    additional global names that conflict at link time, then those parser
  20.    generators need to be fixed instead of adding those names to this list. */
  21.  
  22. #define    yymaxdepth chill_maxdepth
  23. #define    yyparse    chill_parse
  24. #define    yylex    chill_lex
  25. #define    yyerror    chill_error
  26. #define    yylval    chill_lval
  27. #define    yychar    chill_char
  28. #define    yydebug    chill_debug
  29. #define    yypact    chill_pact
  30. #define    yyr1    chill_r1
  31. #define    yyr2    chill_r2
  32. #define    yydef    chill_def
  33. #define    yychk    chill_chk
  34. #define    yypgo    chill_pgo
  35. #define    yyact    chill_act
  36. #define    yyexca    chill_exca
  37. #define    yyerrflag chill_errflag
  38. #define    yynerrs    chill_nerrs
  39. #define    yyps    chill_ps
  40. #define    yypv    chill_pv
  41. #define    yys    chill_s
  42. #define    yy_yys    chill_yys
  43. #define    yystate    chill_state
  44. #define    yytmp    chill_tmp
  45. #define    yyv    chill_v
  46. #define    yy_yyv    chill_yyv
  47. #define    yyval    chill_val
  48. #define    yylloc    chill_lloc
  49. #define    yyreds    chill_reds        /* With YYDEBUG defined */
  50. #define    yytoks    chill_toks        /* With YYDEBUG defined */
  51.  
  52. #ifndef YYDEBUG
  53. #define    YYDEBUG    0        /* Default to no yydebug support */
  54. #endif
  55.  
  56. int
  57. yyparse PARAMS ((void));
  58.  
  59. static int
  60. yylex PARAMS ((void));
  61.  
  62. void
  63. yyerror PARAMS ((char *));
  64.  
  65.  
  66. # line 123 "./ch-exp.y"
  67. typedef union 
  68.   {
  69.     LONGEST lval;
  70.     unsigned LONGEST ulval;
  71.     struct {
  72.       LONGEST val;
  73.       struct type *type;
  74.     } typed_val;
  75.     double dval;
  76.     struct symbol *sym;
  77.     struct type *tval;
  78.     struct stoken sval;
  79.     struct ttype tsym;
  80.     struct symtoken ssym;
  81.     int voidval;
  82.     struct block *bval;
  83.     enum exp_opcode opcode;
  84.     struct internalvar *ivar;
  85.  
  86.     struct type **tvec;
  87.     int *ivec;
  88.   } YYSTYPE;
  89. # define FIXME_01 257
  90. # define FIXME_02 258
  91. # define FIXME_03 259
  92. # define FIXME_04 260
  93. # define FIXME_05 261
  94. # define FIXME_06 262
  95. # define FIXME_07 263
  96. # define FIXME_08 264
  97. # define FIXME_09 265
  98. # define FIXME_10 266
  99. # define FIXME_11 267
  100. # define FIXME_12 268
  101. # define FIXME_13 269
  102. # define FIXME_14 270
  103. # define FIXME_15 271
  104. # define FIXME_16 272
  105. # define FIXME_17 273
  106. # define FIXME_18 274
  107. # define FIXME_19 275
  108. # define FIXME_20 276
  109. # define FIXME_21 277
  110. # define FIXME_22 278
  111. # define FIXME_24 279
  112. # define FIXME_25 280
  113. # define FIXME_26 281
  114. # define FIXME_27 282
  115. # define FIXME_28 283
  116. # define FIXME_29 284
  117. # define FIXME_30 285
  118. # define INTEGER_LITERAL 286
  119. # define BOOLEAN_LITERAL 287
  120. # define CHARACTER_LITERAL 288
  121. # define FLOAT_LITERAL 289
  122. # define GENERAL_PROCEDURE_NAME 290
  123. # define LOCATION_NAME 291
  124. # define SET_LITERAL 292
  125. # define EMPTINESS_LITERAL 293
  126. # define CHARACTER_STRING_LITERAL 294
  127. # define BIT_STRING_LITERAL 295
  128. # define TYPENAME 296
  129. # define FIELD_NAME 297
  130. # define CASE 298
  131. # define OF 299
  132. # define ESAC 300
  133. # define LOGIOR 301
  134. # define ORIF 302
  135. # define LOGXOR 303
  136. # define LOGAND 304
  137. # define ANDIF 305
  138. # define NOTEQUAL 306
  139. # define GTR 307
  140. # define LEQ 308
  141. # define IN 309
  142. # define SLASH_SLASH 310
  143. # define MOD 311
  144. # define REM 312
  145. # define NOT 313
  146. # define POINTER 314
  147. # define RECEIVE 315
  148. # define UP 316
  149. # define IF 317
  150. # define THEN 318
  151. # define ELSE 319
  152. # define FI 320
  153. # define ELSIF 321
  154. # define ILLEGAL_TOKEN 322
  155. # define NUM 323
  156. # define PRED 324
  157. # define SUCC 325
  158. # define ABS 326
  159. # define CARD 327
  160. # define MAX_TOKEN 328
  161. # define MIN_TOKEN 329
  162. # define SIZE 330
  163. # define UPPER 331
  164. # define LOWER 332
  165. # define LENGTH 333
  166. # define GDB_REGNAME 334
  167. # define GDB_LAST 335
  168. # define GDB_VARIABLE 336
  169. # define GDB_ASSIGNMENT 337
  170. #define yyclearin yychar = -1
  171. #define yyerrok yyerrflag = 0
  172. extern int yychar;
  173. extern int yyerrflag;
  174. #ifndef YYMAXDEPTH
  175. #define YYMAXDEPTH 150
  176. #endif
  177. YYSTYPE yylval, yyval;
  178. # define YYERRCODE 256
  179.  
  180. # line 996 "./ch-exp.y"
  181.  
  182.  
  183. /* Implementation of a dynamically expandable buffer for processing input
  184.    characters acquired through lexptr and building a value to return in
  185.    yylval. */
  186.  
  187. static char *tempbuf;        /* Current buffer contents */
  188. static int tempbufsize;        /* Size of allocated buffer */
  189. static int tempbufindex;    /* Current index into buffer */
  190.  
  191. #define GROWBY_MIN_SIZE 64    /* Minimum amount to grow buffer by */
  192.  
  193. #define CHECKBUF(size) \
  194.   do { \
  195.     if (tempbufindex + (size) >= tempbufsize) \
  196.       { \
  197.     growbuf_by_size (size); \
  198.       } \
  199.   } while (0);
  200.  
  201. /* Grow the static temp buffer if necessary, including allocating the first one
  202.    on demand. */
  203.  
  204. static void
  205. growbuf_by_size (count)
  206.      int count;
  207. {
  208.   int growby;
  209.  
  210.   growby = max (count, GROWBY_MIN_SIZE);
  211.   tempbufsize += growby;
  212.   if (tempbuf == NULL)
  213.     {
  214.       tempbuf = (char *) xmalloc (tempbufsize);
  215.     }
  216.   else
  217.     {
  218.       tempbuf = (char *) xrealloc (tempbuf, tempbufsize);
  219.     }
  220. }
  221.  
  222. /* Try to consume a simple name string token.  If successful, returns
  223.    a pointer to a nullbyte terminated copy of the name that can be used
  224.    in symbol table lookups.  If not successful, returns NULL. */
  225.  
  226. static char *
  227. match_simple_name_string ()
  228. {
  229.   char *tokptr = lexptr;
  230.  
  231.   if (isalpha (*tokptr))
  232.     {
  233.       char *result;
  234.       do {
  235.     tokptr++;
  236.       } while (isalnum (*tokptr) || (*tokptr == '_'));
  237.       yylval.sval.ptr = lexptr;
  238.       yylval.sval.length = tokptr - lexptr;
  239.       lexptr = tokptr;
  240.       result = copy_name (yylval.sval);
  241.       for (tokptr = result; *tokptr; tokptr++)
  242.     if (isupper (*tokptr))
  243.       *tokptr = tolower(*tokptr);
  244.       return result;
  245.     }
  246.   return (NULL);
  247. }
  248.  
  249. /* Start looking for a value composed of valid digits as set by the base
  250.    in use.  Note that '_' characters are valid anywhere, in any quantity,
  251.    and are simply ignored.  Since we must find at least one valid digit,
  252.    or reject this token as an integer literal, we keep track of how many
  253.    digits we have encountered. */
  254.   
  255. static int
  256. decode_integer_value (base, tokptrptr, ivalptr)
  257.   int base;
  258.   char **tokptrptr;
  259.   int *ivalptr;
  260. {
  261.   char *tokptr = *tokptrptr;
  262.   int temp;
  263.   int digits = 0;
  264.  
  265.   while (*tokptr != '\0')
  266.     {
  267.       temp = tolower (*tokptr);
  268.       tokptr++;
  269.       switch (temp)
  270.     {
  271.     case '_':
  272.       continue;
  273.     case '0':  case '1':  case '2':  case '3':  case '4':
  274.     case '5':  case '6':  case '7':  case '8':  case '9':
  275.       temp -= '0';
  276.       break;
  277.     case 'a':  case 'b':  case 'c':  case 'd':  case 'e': case 'f':
  278.       temp -= 'a';
  279.       temp += 10;
  280.       break;
  281.     default:
  282.       temp = base;
  283.       break;
  284.     }
  285.       if (temp < base)
  286.     {
  287.       digits++;
  288.       *ivalptr *= base;
  289.       *ivalptr += temp;
  290.     }
  291.       else
  292.     {
  293.       /* Found something not in domain for current base. */
  294.       tokptr--;    /* Unconsume what gave us indigestion. */
  295.       break;
  296.     }
  297.     }
  298.   
  299.   /* If we didn't find any digits, then we don't have a valid integer
  300.      value, so reject the entire token.  Otherwise, update the lexical
  301.      scan pointer, and return non-zero for success. */
  302.   
  303.   if (digits == 0)
  304.     {
  305.       return (0);
  306.     }
  307.   else
  308.     {
  309.       *tokptrptr = tokptr;
  310.       return (1);
  311.     }
  312. }
  313.  
  314. static int
  315. decode_integer_literal (valptr, tokptrptr)
  316.   int *valptr;
  317.   char **tokptrptr;
  318. {
  319.   char *tokptr = *tokptrptr;
  320.   int base = 0;
  321.   int ival = 0;
  322.   int explicit_base = 0;
  323.   
  324.   /* Look for an explicit base specifier, which is optional. */
  325.   
  326.   switch (*tokptr)
  327.     {
  328.     case 'd':
  329.     case 'D':
  330.       explicit_base++;
  331.       base = 10;
  332.       tokptr++;
  333.       break;
  334.     case 'b':
  335.     case 'B':
  336.       explicit_base++;
  337.       base = 2;
  338.       tokptr++;
  339.       break;
  340.     case 'h':
  341.     case 'H':
  342.       explicit_base++;
  343.       base = 16;
  344.       tokptr++;
  345.       break;
  346.     case 'o':
  347.     case 'O':
  348.       explicit_base++;
  349.       base = 8;
  350.       tokptr++;
  351.       break;
  352.     default:
  353.       base = 10;
  354.       break;
  355.     }
  356.   
  357.   /* If we found an explicit base ensure that the character after the
  358.      explicit base is a single quote. */
  359.   
  360.   if (explicit_base && (*tokptr++ != '\''))
  361.     {
  362.       return (0);
  363.     }
  364.   
  365.   /* Attempt to decode whatever follows as an integer value in the
  366.      indicated base, updating the token pointer in the process and
  367.      computing the value into ival.  Also, if we have an explicit
  368.      base, then the next character must not be a single quote, or we
  369.      have a bitstring literal, so reject the entire token in this case.
  370.      Otherwise, update the lexical scan pointer, and return non-zero
  371.      for success. */
  372.  
  373.   if (!decode_integer_value (base, &tokptr, &ival))
  374.     {
  375.       return (0);
  376.     }
  377.   else if (explicit_base && (*tokptr == '\''))
  378.     {
  379.       return (0);
  380.     }
  381.   else
  382.     {
  383.       *valptr = ival;
  384.       *tokptrptr = tokptr;
  385.       return (1);
  386.     }
  387. }
  388.  
  389. /*  If it wasn't for the fact that floating point values can contain '_'
  390.     characters, we could just let strtod do all the hard work by letting it
  391.     try to consume as much of the current token buffer as possible and
  392.     find a legal conversion.  Unfortunately we need to filter out the '_'
  393.     characters before calling strtod, which we do by copying the other
  394.     legal chars to a local buffer to be converted.  However since we also
  395.     need to keep track of where the last unconsumed character in the input
  396.     buffer is, we have transfer only as many characters as may compose a
  397.     legal floating point value. */
  398.     
  399. static int
  400. match_float_literal ()
  401. {
  402.   char *tokptr = lexptr;
  403.   char *buf;
  404.   char *copy;
  405.   double dval;
  406.   extern double strtod ();
  407.   
  408.   /* Make local buffer in which to build the string to convert.  This is
  409.      required because underscores are valid in chill floating point numbers
  410.      but not in the string passed to strtod to convert.  The string will be
  411.      no longer than our input string. */
  412.      
  413.   copy = buf = (char *) alloca (strlen (tokptr) + 1);
  414.  
  415.   /* Transfer all leading digits to the conversion buffer, discarding any
  416.      underscores. */
  417.  
  418.   while (isdigit (*tokptr) || *tokptr == '_')
  419.     {
  420.       if (*tokptr != '_')
  421.     {
  422.       *copy++ = *tokptr;
  423.     }
  424.       tokptr++;
  425.     }
  426.  
  427.   /* Now accept either a '.', or one of [eEdD].  Dot is legal regardless
  428.      of whether we found any leading digits, and we simply accept it and
  429.      continue on to look for the fractional part and/or exponent.  One of
  430.      [eEdD] is legal only if we have seen digits, and means that there
  431.      is no fractional part.  If we find neither of these, then this is
  432.      not a floating point number, so return failure. */
  433.  
  434.   switch (*tokptr++)
  435.     {
  436.       case '.':
  437.         /* Accept and then look for fractional part and/or exponent. */
  438.     *copy++ = '.';
  439.     break;
  440.  
  441.       case 'e':
  442.       case 'E':
  443.       case 'd':
  444.       case 'D':
  445.     if (copy == buf)
  446.       {
  447.         return (0);
  448.       }
  449.     *copy++ = 'e';
  450.     goto collect_exponent;
  451.     break;
  452.  
  453.       default:
  454.     return (0);
  455.         break;
  456.     }
  457.  
  458.   /* We found a '.', copy any fractional digits to the conversion buffer, up
  459.      to the first nondigit, non-underscore character. */
  460.  
  461.   while (isdigit (*tokptr) || *tokptr == '_')
  462.     {
  463.       if (*tokptr != '_')
  464.     {
  465.       *copy++ = *tokptr;
  466.     }
  467.       tokptr++;
  468.     }
  469.  
  470.   /* Look for an exponent, which must start with one of [eEdD].  If none
  471.      is found, jump directly to trying to convert what we have collected
  472.      so far. */
  473.  
  474.   switch (*tokptr)
  475.     {
  476.       case 'e':
  477.       case 'E':
  478.       case 'd':
  479.       case 'D':
  480.     *copy++ = 'e';
  481.     tokptr++;
  482.     break;
  483.       default:
  484.     goto convert_float;
  485.     break;
  486.     }
  487.  
  488.   /* Accept an optional '-' or '+' following one of [eEdD]. */
  489.  
  490.   collect_exponent:
  491.   if (*tokptr == '+' || *tokptr == '-')
  492.     {
  493.       *copy++ = *tokptr++;
  494.     }
  495.  
  496.   /* Now copy an exponent into the conversion buffer.  Note that at the 
  497.      moment underscores are *not* allowed in exponents. */
  498.  
  499.   while (isdigit (*tokptr))
  500.     {
  501.       *copy++ = *tokptr++;
  502.     }
  503.  
  504.   /* If we transfered any chars to the conversion buffer, try to interpret its
  505.      contents as a floating point value.  If any characters remain, then we
  506.      must not have a valid floating point string. */
  507.  
  508.   convert_float:
  509.   *copy = '\0';
  510.   if (copy != buf)
  511.       {
  512.         dval = strtod (buf, ©);
  513.         if (*copy == '\0')
  514.       {
  515.         yylval.dval = dval;
  516.         lexptr = tokptr;
  517.         return (FLOAT_LITERAL);
  518.       }
  519.       }
  520.   return (0);
  521. }
  522.  
  523. /* Recognize a string literal.  A string literal is a nonzero sequence
  524.    of characters enclosed in matching single or double quotes, except that
  525.    a single character inside single quotes is a character literal, which
  526.    we reject as a string literal.  To embed the terminator character inside
  527.    a string, it is simply doubled (I.E. "this""is""one""string") */
  528.  
  529. static int
  530. match_string_literal ()
  531. {
  532.   char *tokptr = lexptr;
  533.  
  534.   for (tempbufindex = 0, tokptr++; *tokptr != '\0'; tokptr++)
  535.     {
  536.       CHECKBUF (1);
  537.       if (*tokptr == *lexptr)
  538.     {
  539.       if (*(tokptr + 1) == *lexptr)
  540.         {
  541.           tokptr++;
  542.         }
  543.       else
  544.         {
  545.           break;
  546.         }
  547.     }
  548.       tempbuf[tempbufindex++] = *tokptr;
  549.     }
  550.   if (*tokptr == '\0'                    /* no terminator */
  551.       || tempbufindex == 0                /* no string */
  552.       || (tempbufindex == 1 && *tokptr == '\''))    /* char literal */
  553.     {
  554.       return (0);
  555.     }
  556.   else
  557.     {
  558.       tempbuf[tempbufindex] = '\0';
  559.       yylval.sval.ptr = tempbuf;
  560.       yylval.sval.length = tempbufindex;
  561.       lexptr = ++tokptr;
  562.       return (CHARACTER_STRING_LITERAL);
  563.     }
  564. }
  565.  
  566. /* Recognize a character literal.  A character literal is single character
  567.    or a control sequence, enclosed in single quotes.  A control sequence
  568.    is a comma separated list of one or more integer literals, enclosed
  569.    in parenthesis and introduced with a circumflex character.
  570.  
  571.    EX:  'a'  '^(7)'  '^(7,8)'
  572.  
  573.    As a GNU chill extension, the syntax C'xx' is also recognized as a 
  574.    character literal, where xx is a hex value for the character.
  575.  
  576.    Note that more than a single character, enclosed in single quotes, is
  577.    a string literal.
  578.  
  579.    Also note that the control sequence form is not in GNU Chill since it
  580.    is ambiguous with the string literal form using single quotes.  I.E.
  581.    is '^(7)' a character literal or a string literal.  In theory it it
  582.    possible to tell by context, but GNU Chill doesn't accept the control
  583.    sequence form, so neither do we (for now the code is disabled).
  584.  
  585.    Returns CHARACTER_LITERAL if a match is found.
  586.    */
  587.  
  588. static int
  589. match_character_literal ()
  590. {
  591.   char *tokptr = lexptr;
  592.   int ival = 0;
  593.   
  594.   if ((tolower (*tokptr) == 'c') && (*(tokptr + 1) == '\''))
  595.     {
  596.       /* We have a GNU chill extension form, so skip the leading "C'",
  597.      decode the hex value, and then ensure that we have a trailing
  598.      single quote character. */
  599.       tokptr += 2;
  600.       if (!decode_integer_value (16, &tokptr, &ival) || (*tokptr != '\''))
  601.     {
  602.       return (0);
  603.     }
  604.       tokptr++;
  605.     }
  606.   else if (*tokptr == '\'')
  607.     {
  608.       tokptr++;
  609.  
  610.       /* Determine which form we have, either a control sequence or the
  611.      single character form. */
  612.       
  613.       if ((*tokptr == '^') && (*(tokptr + 1) == '('))
  614.     {
  615. #if 0     /* Disable, see note above. -fnf */
  616.       /* Match and decode a control sequence.  Return zero if we don't
  617.          find a valid integer literal, or if the next unconsumed character
  618.          after the integer literal is not the trailing ')'.
  619.          FIXME:  We currently don't handle the multiple integer literal
  620.          form. */
  621.       tokptr += 2;
  622.       if (!decode_integer_literal (&ival, &tokptr) || (*tokptr++ != ')'))
  623.         {
  624.           return (0);
  625.         }
  626. #else
  627.       return (0);
  628. #endif
  629.     }
  630.       else
  631.     {
  632.       ival = *tokptr++;
  633.     }
  634.       
  635.       /* The trailing quote has not yet been consumed.  If we don't find
  636.      it, then we have no match. */
  637.       
  638.       if (*tokptr++ != '\'')
  639.     {
  640.       return (0);
  641.     }
  642.     }
  643.   else
  644.     {
  645.       /* Not a character literal. */
  646.       return (0);
  647.     }
  648.   yylval.typed_val.val = ival;
  649.   yylval.typed_val.type = builtin_type_chill_char;
  650.   lexptr = tokptr;
  651.   return (CHARACTER_LITERAL);
  652. }
  653.  
  654. /* Recognize an integer literal, as specified in Z.200 sec 5.2.4.2.
  655.    Note that according to 5.2.4.2, a single "_" is also a valid integer
  656.    literal, however GNU-chill requires there to be at least one "digit"
  657.    in any integer literal. */
  658.  
  659. static int
  660. match_integer_literal ()
  661. {
  662.   char *tokptr = lexptr;
  663.   int ival;
  664.   
  665.   if (!decode_integer_literal (&ival, &tokptr))
  666.     {
  667.       return (0);
  668.     }
  669.   else 
  670.     {
  671.       yylval.typed_val.val = ival;
  672.       yylval.typed_val.type = builtin_type_int;
  673.       lexptr = tokptr;
  674.       return (INTEGER_LITERAL);
  675.     }
  676. }
  677.  
  678. /* Recognize a bit-string literal, as specified in Z.200 sec 5.2.4.8
  679.    Note that according to 5.2.4.8, a single "_" is also a valid bit-string
  680.    literal, however GNU-chill requires there to be at least one "digit"
  681.    in any bit-string literal. */
  682.  
  683. static int
  684. match_bitstring_literal ()
  685. {
  686.   char *tokptr = lexptr;
  687.   int mask;
  688.   int bitoffset = 0;
  689.   int bitcount = 0;
  690.   int base;
  691.   int digit;
  692.   
  693.   tempbufindex = 0;
  694.  
  695.   /* Look for the required explicit base specifier. */
  696.   
  697.   switch (*tokptr++)
  698.     {
  699.     case 'b':
  700.     case 'B':
  701.       base = 2;
  702.       break;
  703.     case 'o':
  704.     case 'O':
  705.       base = 8;
  706.       break;
  707.     case 'h':
  708.     case 'H':
  709.       base = 16;
  710.       break;
  711.     default:
  712.       return (0);
  713.       break;
  714.     }
  715.   
  716.   /* Ensure that the character after the explicit base is a single quote. */
  717.   
  718.   if (*tokptr++ != '\'')
  719.     {
  720.       return (0);
  721.     }
  722.   
  723.   while (*tokptr != '\0' && *tokptr != '\'')
  724.     {
  725.       digit = tolower (*tokptr);
  726.       tokptr++;
  727.       switch (digit)
  728.     {
  729.       case '_':
  730.         continue;
  731.       case '0':  case '1':  case '2':  case '3':  case '4':
  732.       case '5':  case '6':  case '7':  case '8':  case '9':
  733.         digit -= '0';
  734.         break;
  735.       case 'a':  case 'b':  case 'c':  case 'd':  case 'e': case 'f':
  736.         digit -= 'a';
  737.         digit += 10;
  738.         break;
  739.       default:
  740.         return (0);
  741.         break;
  742.     }
  743.       if (digit >= base)
  744.     {
  745.       /* Found something not in domain for current base. */
  746.       return (0);
  747.     }
  748.       else
  749.     {
  750.       /* Extract bits from digit, starting with the msbit appropriate for
  751.          the current base, and packing them into the bitstring byte,
  752.          starting at the lsbit. */
  753.       for (mask = (base >> 1); mask > 0; mask >>= 1)
  754.         {
  755.           bitcount++;
  756.           CHECKBUF (1);
  757.           if (digit & mask)
  758.         {
  759.           tempbuf[tempbufindex] |= (1 << bitoffset);
  760.         }
  761.           bitoffset++;
  762.           if (bitoffset == HOST_CHAR_BIT)
  763.         {
  764.           bitoffset = 0;
  765.           tempbufindex++;
  766.         }
  767.         }
  768.     }
  769.     }
  770.   
  771.   /* Verify that we consumed everything up to the trailing single quote,
  772.      and that we found some bits (IE not just underbars). */
  773.  
  774.   if (*tokptr++ != '\'')
  775.     {
  776.       return (0);
  777.     }
  778.   else 
  779.     {
  780.       yylval.sval.ptr = tempbuf;
  781.       yylval.sval.length = bitcount;
  782.       lexptr = tokptr;
  783.       return (BIT_STRING_LITERAL);
  784.     }
  785. }
  786.  
  787. /* Recognize tokens that start with '$'.  These include:
  788.  
  789.     $regname    A native register name or a "standard
  790.             register name".
  791.             Return token GDB_REGNAME.
  792.  
  793.     $variable    A convenience variable with a name chosen
  794.             by the user.
  795.             Return token GDB_VARIABLE.
  796.  
  797.     $digits        Value history with index <digits>, starting
  798.             from the first value which has index 1.
  799.             Return GDB_LAST.
  800.  
  801.     $$digits    Value history with index <digits> relative
  802.             to the last value.  I.E. $$0 is the last
  803.             value, $$1 is the one previous to that, $$2
  804.             is the one previous to $$1, etc.
  805.             Return token GDB_LAST.
  806.  
  807.     $ | $0 | $$0    The last value in the value history.
  808.             Return token GDB_LAST.
  809.  
  810.     $$        An abbreviation for the second to the last
  811.             value in the value history, I.E. $$1
  812.             Return token GDB_LAST.
  813.  
  814.     Note that we currently assume that register names and convenience
  815.     variables follow the convention of starting with a letter or '_'.
  816.  
  817.    */
  818.  
  819. static int
  820. match_dollar_tokens ()
  821. {
  822.   char *tokptr;
  823.   int regno;
  824.   int namelength;
  825.   int negate;
  826.   int ival;
  827.  
  828.   /* We will always have a successful match, even if it is just for
  829.      a single '$', the abbreviation for $$0.  So advance lexptr. */
  830.  
  831.   tokptr = ++lexptr;
  832.  
  833.   if (*tokptr == '_' || isalpha (*tokptr))
  834.     {
  835.       /* Look for a match with a native register name, usually something
  836.      like "r0" for example. */
  837.  
  838.       for (regno = 0; regno < NUM_REGS; regno++)
  839.     {
  840.       namelength = strlen (reg_names[regno]);
  841.       if (STREQN (tokptr, reg_names[regno], namelength)
  842.           && !isalnum (tokptr[namelength]))
  843.         {
  844.           yylval.lval = regno;
  845.           lexptr += namelength;
  846.           return (GDB_REGNAME);
  847.         }
  848.     }
  849.  
  850.       /* Look for a match with a standard register name, usually something
  851.      like "pc", which gdb always recognizes as the program counter
  852.      regardless of what the native register name is. */
  853.  
  854.       for (regno = 0; regno < num_std_regs; regno++)
  855.     {
  856.       namelength = strlen (std_regs[regno].name);
  857.       if (STREQN (tokptr, std_regs[regno].name, namelength)
  858.           && !isalnum (tokptr[namelength]))
  859.         {
  860.           yylval.lval = std_regs[regno].regnum;
  861.           lexptr += namelength;
  862.           return (GDB_REGNAME);
  863.         }
  864.     }
  865.  
  866.       /* Attempt to match against a convenience variable.  Note that
  867.      this will always succeed, because if no variable of that name
  868.      already exists, the lookup_internalvar will create one for us.
  869.      Also note that both lexptr and tokptr currently point to the
  870.      start of the input string we are trying to match, and that we
  871.      have already tested the first character for non-numeric, so we
  872.      don't have to treat it specially. */
  873.  
  874.       while (*tokptr == '_' || isalnum (*tokptr))
  875.     {
  876.       tokptr++;
  877.     }
  878.       yylval.sval.ptr = lexptr;
  879.       yylval.sval.length = tokptr - lexptr;
  880.       yylval.ivar = lookup_internalvar (copy_name (yylval.sval));
  881.       lexptr = tokptr;
  882.       return (GDB_VARIABLE);
  883.     }
  884.  
  885.   /* Since we didn't match against a register name or convenience
  886.      variable, our only choice left is a history value. */
  887.  
  888.   if (*tokptr == '$')
  889.     {
  890.       negate = 1;
  891.       ival = 1;
  892.       tokptr++;
  893.     }
  894.   else
  895.     {
  896.       negate = 0;
  897.       ival = 0;
  898.     }
  899.  
  900.   /* Attempt to decode more characters as an integer value giving
  901.      the index in the history list.  If successful, the value will
  902.      overwrite ival (currently 0 or 1), and if not, ival will be
  903.      left alone, which is good since it is currently correct for
  904.      the '$' or '$$' case. */
  905.  
  906.   decode_integer_literal (&ival, &tokptr);
  907.   yylval.lval = negate ? -ival : ival;
  908.   lexptr = tokptr;
  909.   return (GDB_LAST);
  910. }
  911.  
  912. struct token
  913. {
  914.   char *operator;
  915.   int token;
  916. };
  917.  
  918. static const struct token idtokentab[] =
  919. {
  920.     { "length", LENGTH },
  921.     { "lower", LOWER },
  922.     { "upper", UPPER },
  923.     { "andif", ANDIF },
  924.     { "pred", PRED },
  925.     { "succ", SUCC },
  926.     { "card", CARD },
  927.     { "size", SIZE },
  928.     { "orif", ORIF },
  929.     { "num", NUM },
  930.     { "abs", ABS },
  931.     { "max", MAX_TOKEN },
  932.     { "min", MIN_TOKEN },
  933.     { "mod", MOD },
  934.     { "rem", REM },
  935.     { "not", NOT },
  936.     { "xor", LOGXOR },
  937.     { "and", LOGAND },
  938.     { "in", IN },
  939.     { "or", LOGIOR }
  940. };
  941.  
  942. static const struct token tokentab2[] =
  943. {
  944.     { ":=", GDB_ASSIGNMENT },
  945.     { "//", SLASH_SLASH },
  946.     { "->", POINTER },
  947.     { "/=", NOTEQUAL },
  948.     { "<=", LEQ },
  949.     { ">=", GTR }
  950. };
  951.  
  952. /* Read one token, getting characters through lexptr.  */
  953. /* This is where we will check to make sure that the language and the
  954.    operators used are compatible.  */
  955.  
  956. static int
  957. yylex ()
  958. {
  959.     unsigned int i;
  960.     int token;
  961.     char *simplename;
  962.     struct symbol *sym;
  963.  
  964.     /* Skip over any leading whitespace. */
  965.     while (isspace (*lexptr))
  966.     {
  967.         lexptr++;
  968.     }
  969.     /* Look for special single character cases which can't be the first
  970.        character of some other multicharacter token. */
  971.     switch (*lexptr)
  972.     {
  973.         case '\0':
  974.             return (0);
  975.         case ',':
  976.         case '=':
  977.         case ';':
  978.         case '!':
  979.         case '+':
  980.         case '*':
  981.         case '(':
  982.         case ')':
  983.         case '[':
  984.         case ']':
  985.         return (*lexptr++);
  986.     }
  987.     /* Look for characters which start a particular kind of multicharacter
  988.        token, such as a character literal, register name, convenience
  989.        variable name, string literal, etc. */
  990.     switch (*lexptr)
  991.       {
  992.     case '\'':
  993.     case '\"':
  994.       /* First try to match a string literal, which is any nonzero
  995.          sequence of characters enclosed in matching single or double
  996.          quotes, except that a single character inside single quotes
  997.          is a character literal, so we have to catch that case also. */
  998.       token = match_string_literal ();
  999.       if (token != 0)
  1000.         {
  1001.           return (token);
  1002.         }
  1003.       if (*lexptr == '\'')
  1004.         {
  1005.           token = match_character_literal ();
  1006.           if (token != 0)
  1007.         {
  1008.           return (token);
  1009.         }
  1010.         }
  1011.       break;
  1012.         case 'C':
  1013.         case 'c':
  1014.       token = match_character_literal ();
  1015.       if (token != 0)
  1016.         {
  1017.           return (token);
  1018.         }
  1019.       break;
  1020.     case '$':
  1021.       token = match_dollar_tokens ();
  1022.       if (token != 0)
  1023.         {
  1024.           return (token);
  1025.         }
  1026.       break;
  1027.       }
  1028.     /* See if it is a special token of length 2.  */
  1029.     for (i = 0; i < sizeof (tokentab2) / sizeof (tokentab2[0]); i++)
  1030.     {
  1031.         if (STREQN (lexptr, tokentab2[i].operator, 2))
  1032.         {
  1033.             lexptr += 2;
  1034.             return (tokentab2[i].token);
  1035.         }
  1036.     }
  1037.     /* Look for single character cases which which could be the first
  1038.        character of some other multicharacter token, but aren't, or we
  1039.        would already have found it. */
  1040.     switch (*lexptr)
  1041.     {
  1042.         case '-':
  1043.         case ':':
  1044.         case '/':
  1045.         case '<':
  1046.         case '>':
  1047.         return (*lexptr++);
  1048.     }
  1049.     /* Look for a float literal before looking for an integer literal, so
  1050.        we match as much of the input stream as possible. */
  1051.     token = match_float_literal ();
  1052.     if (token != 0)
  1053.     {
  1054.         return (token);
  1055.     }
  1056.     token = match_bitstring_literal ();
  1057.     if (token != 0)
  1058.     {
  1059.         return (token);
  1060.     }
  1061.     token = match_integer_literal ();
  1062.     if (token != 0)
  1063.     {
  1064.         return (token);
  1065.     }
  1066.  
  1067.     /* Try to match a simple name string, and if a match is found, then
  1068.        further classify what sort of name it is and return an appropriate
  1069.        token.  Note that attempting to match a simple name string consumes
  1070.        the token from lexptr, so we can't back out if we later find that
  1071.        we can't classify what sort of name it is. */
  1072.  
  1073.     simplename = match_simple_name_string ();
  1074.  
  1075.     if (simplename != NULL)
  1076.       {
  1077.     /* See if it is a reserved identifier. */
  1078.     for (i = 0; i < sizeof (idtokentab) / sizeof (idtokentab[0]); i++)
  1079.         {
  1080.         if (STREQ (simplename, idtokentab[i].operator))
  1081.             {
  1082.             return (idtokentab[i].token);
  1083.             }
  1084.         }
  1085.  
  1086.     /* Look for other special tokens. */
  1087.     if (STREQ (simplename, "true"))
  1088.         {
  1089.         yylval.ulval = 1;
  1090.         return (BOOLEAN_LITERAL);
  1091.         }
  1092.     if (STREQ (simplename, "false"))
  1093.         {
  1094.         yylval.ulval = 0;
  1095.         return (BOOLEAN_LITERAL);
  1096.         }
  1097.  
  1098.     sym = lookup_symbol (simplename, expression_context_block,
  1099.                  VAR_NAMESPACE, (int *) NULL,
  1100.                  (struct symtab **) NULL);
  1101.     if (sym != NULL)
  1102.       {
  1103.         yylval.ssym.stoken.ptr = NULL;
  1104.         yylval.ssym.stoken.length = 0;
  1105.         yylval.ssym.sym = sym;
  1106.         yylval.ssym.is_a_field_of_this = 0;    /* FIXME, C++'ism */
  1107.         switch (SYMBOL_CLASS (sym))
  1108.           {
  1109.           case LOC_BLOCK:
  1110.         /* Found a procedure name. */
  1111.         return (GENERAL_PROCEDURE_NAME);
  1112.           case LOC_STATIC:
  1113.         /* Found a global or local static variable. */
  1114.         return (LOCATION_NAME);
  1115.           case LOC_REGISTER:
  1116.           case LOC_ARG:
  1117.           case LOC_REF_ARG:
  1118.           case LOC_REGPARM:
  1119.           case LOC_REGPARM_ADDR:
  1120.           case LOC_LOCAL:
  1121.           case LOC_LOCAL_ARG:
  1122.           case LOC_BASEREG:
  1123.           case LOC_BASEREG_ARG:
  1124.         if (innermost_block == NULL
  1125.             || contained_in (block_found, innermost_block))
  1126.           {
  1127.             innermost_block = block_found;
  1128.           }
  1129.         return (LOCATION_NAME);
  1130.         break;
  1131.           case LOC_CONST:
  1132.           case LOC_LABEL:
  1133.         return (LOCATION_NAME);
  1134.         break;
  1135.           case LOC_TYPEDEF:
  1136.         yylval.tsym.type = SYMBOL_TYPE (sym);
  1137.         return TYPENAME;
  1138.           case LOC_UNDEF:
  1139.           case LOC_CONST_BYTES:
  1140.           case LOC_OPTIMIZED_OUT:
  1141.         error ("Symbol \"%s\" names no location.", simplename);
  1142.         break;
  1143.           }
  1144.       }
  1145.     else if (!have_full_symbols () && !have_partial_symbols ())
  1146.       {
  1147.         error ("No symbol table is loaded.  Use the \"file\" command.");
  1148.       }
  1149.     else
  1150.       {
  1151.         error ("No symbol \"%s\" in current context.", simplename);
  1152.       }
  1153.       }
  1154.  
  1155.     /* Catch single character tokens which are not part of some
  1156.        longer token. */
  1157.  
  1158.     switch (*lexptr)
  1159.       {
  1160.     case '.':            /* Not float for example. */
  1161.       lexptr++;
  1162.       while (isspace (*lexptr)) lexptr++;
  1163.       simplename = match_simple_name_string ();
  1164.       if (!simplename)
  1165.         return '.';
  1166.       return FIELD_NAME;
  1167.       }
  1168.  
  1169.     return (ILLEGAL_TOKEN);
  1170. }
  1171.  
  1172. void
  1173. yyerror (msg)
  1174.      char *msg;    /* unused */
  1175. {
  1176.   printf_unfiltered ("Parsing:  %s\n", lexptr);
  1177.   if (yychar < 256)
  1178.     {
  1179.       error ("Invalid syntax in expression near character '%c'.", yychar);
  1180.     }
  1181.   else
  1182.     {
  1183.       error ("Invalid syntax in expression");
  1184.     }
  1185. }
  1186. int yyexca[] ={
  1187. -1, 1,
  1188.     0, -1,
  1189.     -2, 0,
  1190. -1, 17,
  1191.     40, 121,
  1192.     -2, 99,
  1193. -1, 130,
  1194.     297, 30,
  1195.     314, 30,
  1196.     40, 30,
  1197.     -2, 97,
  1198.     };
  1199. # define YYNPROD 142
  1200. # define YYLAST 753
  1201. int yyact[]={
  1202.  
  1203.     60,    89,   190,   237,   191,    79,   219,   141,   203,   107,
  1204.    252,   102,    87,    88,   108,    98,    94,    96,    84,    85,
  1205.     86,   142,   196,    45,    46,    47,    48,   197,   101,    49,
  1206.     50,    51,    52,   133,   193,    93,   103,    91,   104,   164,
  1207.    227,   165,   231,   225,   159,   160,   140,    90,    38,   200,
  1208.    192,    17,    83,   114,     3,   224,   183,    61,   251,   222,
  1209.     15,     2,    78,   250,   223,   202,   238,    11,   199,   247,
  1210.    246,   229,   228,   189,   228,   245,   244,   243,    60,    39,
  1211.    241,   240,   218,    79,   217,   216,   212,   211,   210,   209,
  1212.    208,    18,   207,   206,   205,   204,   166,    60,   215,   214,
  1213.    213,   125,   124,   123,   122,   121,   120,   119,   118,   117,
  1214.    116,   115,   112,   111,   161,     1,    26,     8,   132,   195,
  1215.     92,   179,   178,   177,   187,   175,   163,   230,   127,   127,
  1216.    127,   162,    55,   131,   226,   158,   157,    54,    43,    42,
  1217.     41,    40,   126,   129,     7,   194,     9,     5,   137,   138,
  1218.     37,   139,   134,   135,   136,   106,    60,    36,    57,    35,
  1219.     34,    79,    33,    83,    32,   153,   154,   155,   156,    31,
  1220.     60,   127,    30,    29,   131,    28,   176,   185,   185,    27,
  1221.     25,   186,    24,   150,   151,   152,   143,   144,   145,   146,
  1222.    147,   148,   149,    16,     0,     0,     0,     0,     0,     0,
  1223.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1224.      0,     0,     0,     0,     0,     0,     0,    10,     0,    23,
  1225.     53,    56,    58,    59,     0,    83,     0,    62,    63,    64,
  1226.     65,    66,     0,     0,    83,     0,     0,     0,     0,   221,
  1227.      0,   220,     0,     0,     0,     0,    45,    46,    47,    48,
  1228.     44,    19,    49,    50,    51,    52,     6,    60,    14,   232,
  1229.      0,    95,    97,    99,   100,   235,     0,     0,   236,     0,
  1230.      0,    60,     0,    80,    81,    82,     0,    13,   109,   110,
  1231.      0,     0,     0,    67,    68,    69,    70,    71,    72,    73,
  1232.     74,    75,    76,    77,    21,    20,    22,    23,    53,    56,
  1233.     58,    59,   198,   105,   249,    62,    63,    64,    65,    66,
  1234.    248,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1235.      0,     0,     0,     0,    45,    46,    47,    48,    44,    19,
  1236.     49,    50,    51,    52,     6,     0,    14,     0,     0,     0,
  1237.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1238.      0,    80,    81,    82,     0,    13,     0,     0,     0,     0,
  1239.      0,    67,    68,    69,    70,    71,    72,    73,    74,    75,
  1240.     76,    77,    21,    20,    22,    23,    53,    56,    58,    59,
  1241.      0,     0,     0,    62,    63,    64,    65,    66,     0,    23,
  1242.     53,    56,    58,    59,   180,   181,   182,    62,    63,    64,
  1243.     65,    66,    45,    46,    47,    48,    44,    19,    49,    50,
  1244.     51,    52,     6,     0,     0,     0,    45,    46,    47,    48,
  1245.     44,    19,    49,    50,    51,    52,     6,     0,     0,    80,
  1246.     81,    82,     0,     0,     0,     0,     0,     0,     0,    67,
  1247.     68,    69,    70,    71,    72,    73,    74,    75,    76,    77,
  1248.     21,    20,    22,    67,    68,    69,    70,    71,    72,    73,
  1249.     74,    75,    76,    77,    21,    20,    22,     4,     0,     0,
  1250.      0,     0,     0,     0,     0,     0,    23,    53,    56,    58,
  1251.     59,     0,     0,     0,    62,    63,    64,    65,    66,     0,
  1252.     23,    53,    56,    58,    59,     0,     0,     0,    62,    63,
  1253.     64,    65,    66,    45,    46,    47,    48,    44,    19,    49,
  1254.     50,    51,    52,     6,   128,    12,     0,    45,    46,    47,
  1255.     48,    44,    19,    49,    50,    51,    52,     6,   113,     0,
  1256.      0,    81,    82,     0,     0,     0,     0,     0,     0,     0,
  1257.     67,    68,    69,    70,    71,    72,    73,    74,    75,    76,
  1258.     77,    21,    20,    22,    67,    68,    69,    70,    71,    72,
  1259.     73,    74,    75,    76,    77,    21,    20,    22,     0,     0,
  1260.      0,     0,     0,     0,     0,    12,     0,     0,     0,     0,
  1261.      0,     0,     0,   167,   168,   169,   170,   171,   172,   173,
  1262.      0,   184,   184,   188,     0,     0,   130,     0,     0,     0,
  1263.      0,     0,     0,     0,    12,     0,     0,     0,     0,     0,
  1264.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1265.      0,     0,     0,     0,     0,     0,     0,     0,     0,   201,
  1266.     12,    12,    12,    12,    12,    12,    12,   174,    12,    12,
  1267.     12,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1268.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1269.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1270.      0,     0,     0,     0,     0,     0,    12,     0,     0,     0,
  1271.      0,   233,   234,   201,     0,     0,     0,     0,     0,     0,
  1272.      0,   239,     0,     0,     0,     0,   242,     0,     0,     0,
  1273.      0,     0,     0,     0,     0,   239,     0,     0,     0,     0,
  1274.      0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
  1275.      0,     0,     0,     0,     0,     0,     0,     0,    12,    12,
  1276.     12,     0,     0,     0,     0,     0,     0,     0,    12,     0,
  1277.      0,     0,     0,    12,     0,     0,     0,     0,     0,     0,
  1278.      0,     0,    12 };
  1279. int yypact[]={
  1280.  
  1281.    -40, -1000, -1000,    57, -1000, -1000, -1000,  -283, -1000, -1000,
  1282.  -1000,  -292,  -336,  -244,  -247,   -45, -1000,  -286,    -7, -1000,
  1283.  -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
  1284.  -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,  -263,   -33,
  1285.  -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,
  1286.  -1000, -1000, -1000, -1000,    73,    72, -1000, -1000, -1000, -1000,
  1287.     38, -1000, -1000, -1000, -1000, -1000, -1000,    71,    70,    69,
  1288.     68,    67,    66,    65,    64,    63,    62,    61, -1000,   217,
  1289.    217,   231,  -252, -1000,   116,   116,   116,   116,   116,   -40,
  1290.   -311, -1000,  -278, -1000,   116,   116,   116,   116,   116,   116,
  1291.    116, -1000, -1000,   116,   116,   116, -1000,   116,   116,   116,
  1292.    116,  -228,  -237,    55,    57,    38,    38,    38,    38,    38,
  1293.     38,    38,   130,    38,    38,    38, -1000, -1000, -1000, -1000,
  1294.  -1000,  -286, -1000, -1000,  -292,  -292,  -292,   -45,   -45, -1000,
  1295.   -317,  -249,  -262,    -7,    -7,    -7,    -7,    -7,    -7,    -7,
  1296.    -33,   -33,   -33, -1000, -1000, -1000, -1000,   -14,    10, -1000,
  1297.  -1000,    38,     7,  -308, -1000, -1000, -1000,    54,    53,    52,
  1298.     51,    49,    48,    47,    46,    45,    57,    60,    59,    58,
  1299.  -1000, -1000, -1000,    44, -1000,    57,    43,    41, -1000,  -314,
  1300.   -249,  -244, -1000, -1000,   -32,     6, -1000, -1000,  -232,  -234,
  1301.     30, -1000,  -235,  -232, -1000, -1000, -1000, -1000, -1000, -1000,
  1302.  -1000, -1000, -1000,    38,    38,    38, -1000, -1000, -1000, -1000,
  1303.  -1000,  -311,  -316,    38,    40, -1000,    39, -1000,    38, -1000,
  1304.     36, -1000,    35,    34,    29,    28,  -317,    38,     4, -1000,
  1305.  -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000, -1000,   -35,
  1306.  -1000,  -290, -1000 };
  1307. int yypgo[]={
  1308.  
  1309.      0,   514,   193,    51,   182,   180,   116,   179,   175,   173,
  1310.    172,   169,   164,   162,   160,   159,   158,   157,   150,    48,
  1311.     61,   147,   467,   146,    46,    73,    66,   145,   144,    67,
  1312.     60,    91,    79,    57,    62,   141,   140,   139,   138,   137,
  1313.    136,   135,   134,    55,   132,    49,   131,   127,   126,   125,
  1314.     56,   124,   123,   122,   121,    47,   120,    50,   119,   118,
  1315.    117,    53,   115,   114 };
  1316. int yyr1[]={
  1317.  
  1318.      0,    62,    62,    20,    20,    21,     1,     1,     2,     2,
  1319.      2,     2,     2,    45,    45,     3,     3,     3,     3,     3,
  1320.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  1321.      4,     5,     5,     5,     5,     5,     6,     6,     6,     6,
  1322.      6,     6,     6,     6,     7,     8,     9,     9,    63,    10,
  1323.     11,    11,    12,    13,    14,    15,    17,    18,    19,    22,
  1324.     22,    22,    23,    23,    24,    25,    25,    26,    27,    28,
  1325.     28,    28,    28,    29,    29,    29,    30,    30,    30,    30,
  1326.     30,    30,    30,    30,    31,    31,    31,    31,    32,    32,
  1327.     32,    32,    32,    33,    33,    33,    33,    34,    34,    34,
  1328.     60,    16,    16,    16,    16,    16,    16,    16,    16,    16,
  1329.     16,    16,    16,    49,    49,    49,    49,    61,    50,    50,
  1330.     51,    44,    52,    53,    54,    35,    36,    37,    38,    39,
  1331.     40,    41,    42,    43,    46,    47,    48,    55,    56,    57,
  1332.     58,    59 };
  1333. int yyr2[]={
  1334.  
  1335.      0,     3,     3,     3,     3,     3,     2,     5,     3,     3,
  1336.      3,     3,     3,     3,     7,     3,     3,     3,     3,     3,
  1337.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  1338.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  1339.      3,     3,     3,     3,     3,     9,    13,    13,     1,    11,
  1340.     13,    13,     5,     5,     3,     3,     3,     3,     7,     3,
  1341.      3,     3,    11,    19,     5,     5,     9,     3,     9,     3,
  1342.      7,     7,     7,     3,     7,     7,     3,     7,     7,     7,
  1343.      7,     7,     7,     7,     3,     7,     7,     7,     3,     7,
  1344.      7,     7,     7,     3,     5,     5,     5,     5,     5,     3,
  1345.      7,     9,     9,     9,     9,     9,     9,     9,     9,     9,
  1346.      9,     9,     9,     3,     9,     9,     9,     2,     3,     3,
  1347.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  1348.      3,     3,     3,     3,     3,     3,     3,     3,     3,     3,
  1349.      3,     3 };
  1350. int yychk[]={
  1351.  
  1352.  -1000,   -62,   -20,   -61,   -22,   -21,   296,   -28,   -60,   -23,
  1353.    257,   -29,    -1,   317,   298,   -30,    -2,    -3,   -31,   291,
  1354.    335,   334,   336,   259,    -4,    -5,    -6,    -7,    -8,    -9,
  1355.    -10,   -11,   -12,   -13,   -14,   -15,   -17,   -18,   -19,   -32,
  1356.    -35,   -36,   -37,   -38,   290,   286,   287,   288,   289,   292,
  1357.    293,   294,   295,   260,   -39,   -44,   261,   -16,   262,   263,
  1358.     40,   -33,   267,   268,   269,   270,   271,   323,   324,   325,
  1359.    326,   327,   328,   329,   330,   331,   332,   333,   -34,    45,
  1360.    313,   314,   315,   -19,   301,   302,   303,   304,   305,   337,
  1361.    -55,   281,   -56,   282,    61,   306,    62,   307,    60,   308,
  1362.    309,   314,   297,    43,    45,   310,    -6,    42,    47,   311,
  1363.    312,    40,    40,   -22,   -61,    40,    40,    40,    40,    40,
  1364.     40,    40,    40,    40,    40,    40,   -34,   -19,    -1,   -34,
  1365.     -1,    -3,   -59,   285,   -29,   -29,   -29,   -30,   -30,   -20,
  1366.    -24,   318,   299,   -31,   -31,   -31,   -31,   -31,   -31,   -31,
  1367.    -32,   -32,   -32,   -33,   -33,   -33,   -33,   -40,   -41,   272,
  1368.    273,   -63,   -46,   -48,   276,   278,    41,   -22,   -22,   -22,
  1369.    -22,   -22,   -22,   -22,    -1,   -49,   -61,   -52,   -53,   -54,
  1370.    264,   265,   266,   -50,   -22,   -61,   -50,   -51,   -22,   -25,
  1371.    319,   321,   -57,   283,   -27,   -58,   284,    41,   316,    58,
  1372.    -45,   -22,    58,   316,    41,    41,    41,    41,    41,    41,
  1373.     41,    41,    41,    40,    40,    40,    41,    41,    41,   320,
  1374.    -57,   -55,    91,    58,   -43,   275,   -42,   274,    44,    41,
  1375.    -47,   277,   -43,   -22,   -22,   -45,   -24,   319,   -26,   -22,
  1376.     41,    41,   -22,    41,    41,    41,    41,    41,   -25,   -26,
  1377.     59,    93,   300 };
  1378. int yydef[]={
  1379.  
  1380.      0,    -2,     1,     2,     3,     4,   117,    59,    60,    61,
  1381.      5,    69,    30,     0,     0,    73,     6,    -2,    76,     8,
  1382.      9,    10,    11,    12,    15,    16,    17,    18,    19,    20,
  1383.     21,    22,    23,    24,    25,    26,    27,    28,    29,    84,
  1384.     31,    32,    33,    34,    35,    36,    37,    38,    39,    40,
  1385.     41,    42,    43,    44,     0,     0,    54,    55,    56,    57,
  1386.      0,    88,   125,   126,   127,   128,   129,     0,     0,     0,
  1387.      0,     0,     0,     0,     0,     0,     0,     0,    93,     0,
  1388.      0,     0,     0,    53,     0,     0,     0,     0,     0,     0,
  1389.      0,   137,     0,   138,     0,     0,     0,     0,     0,     0,
  1390.      0,     7,    52,     0,     0,     0,    96,     0,     0,     0,
  1391.      0,     0,    48,     0,     0,     0,     0,     0,     0,     0,
  1392.      0,     0,     0,     0,     0,     0,    94,    29,    30,    95,
  1393.     -2,   121,    98,   141,    70,    71,    72,    74,    75,   100,
  1394.      0,     0,     0,    77,    78,    79,    80,    81,    82,    83,
  1395.     85,    86,    87,    89,    90,    91,    92,     0,     0,   130,
  1396.    131,     0,     0,     0,   134,   136,    58,     0,     0,     0,
  1397.      0,     0,     0,     0,    30,     0,   113,     0,     0,     0,
  1398.    122,   123,   124,     0,   118,   119,     0,     0,   120,     0,
  1399.      0,     0,    64,   139,     0,     0,   140,    45,     0,     0,
  1400.      0,    13,     0,     0,   101,   102,   103,   104,   105,   106,
  1401.    107,   108,   109,     0,     0,     0,   110,   111,   112,    62,
  1402.     65,     0,     0,     0,     0,   133,     0,   132,     0,    49,
  1403.      0,   135,     0,     0,     0,     0,     0,     0,     0,    67,
  1404.     47,    46,    14,    50,    51,   114,   115,   116,    66,     0,
  1405.     68,     0,    63 };
  1406. typedef struct { char *t_name; int t_val; } yytoktype;
  1407. #ifndef YYDEBUG
  1408. #    define YYDEBUG    0    /* don't allow debugging */
  1409. #endif
  1410.  
  1411. #if YYDEBUG
  1412.  
  1413. yytoktype yytoks[] =
  1414. {
  1415.     "FIXME_01",    257,
  1416.     "FIXME_02",    258,
  1417.     "FIXME_03",    259,
  1418.     "FIXME_04",    260,
  1419.     "FIXME_05",    261,
  1420.     "FIXME_06",    262,
  1421.     "FIXME_07",    263,
  1422.     "FIXME_08",    264,
  1423.     "FIXME_09",    265,
  1424.     "FIXME_10",    266,
  1425.     "FIXME_11",    267,
  1426.     "FIXME_12",    268,
  1427.     "FIXME_13",    269,
  1428.     "FIXME_14",    270,
  1429.     "FIXME_15",    271,
  1430.     "FIXME_16",    272,
  1431.     "FIXME_17",    273,
  1432.     "FIXME_18",    274,
  1433.     "FIXME_19",    275,
  1434.     "FIXME_20",    276,
  1435.     "FIXME_21",    277,
  1436.     "FIXME_22",    278,
  1437.     "FIXME_24",    279,
  1438.     "FIXME_25",    280,
  1439.     "FIXME_26",    281,
  1440.     "FIXME_27",    282,
  1441.     "FIXME_28",    283,
  1442.     "FIXME_29",    284,
  1443.     "FIXME_30",    285,
  1444.     "INTEGER_LITERAL",    286,
  1445.     "BOOLEAN_LITERAL",    287,
  1446.     "CHARACTER_LITERAL",    288,
  1447.     "FLOAT_LITERAL",    289,
  1448.     "GENERAL_PROCEDURE_NAME",    290,
  1449.     "LOCATION_NAME",    291,
  1450.     "SET_LITERAL",    292,
  1451.     "EMPTINESS_LITERAL",    293,
  1452.     "CHARACTER_STRING_LITERAL",    294,
  1453.     "BIT_STRING_LITERAL",    295,
  1454.     "TYPENAME",    296,
  1455.     "FIELD_NAME",    297,
  1456.     ".",    46,
  1457.     ";",    59,
  1458.     ":",    58,
  1459.     "CASE",    298,
  1460.     "OF",    299,
  1461.     "ESAC",    300,
  1462.     "LOGIOR",    301,
  1463.     "ORIF",    302,
  1464.     "LOGXOR",    303,
  1465.     "LOGAND",    304,
  1466.     "ANDIF",    305,
  1467.     "=",    61,
  1468.     "NOTEQUAL",    306,
  1469.     ">",    62,
  1470.     "GTR",    307,
  1471.     "<",    60,
  1472.     "LEQ",    308,
  1473.     "IN",    309,
  1474.     "+",    43,
  1475.     "-",    45,
  1476.     "*",    42,
  1477.     "/",    47,
  1478.     "SLASH_SLASH",    310,
  1479.     "MOD",    311,
  1480.     "REM",    312,
  1481.     "NOT",    313,
  1482.     "POINTER",    314,
  1483.     "RECEIVE",    315,
  1484.     "[",    91,
  1485.     "]",    93,
  1486.     "(",    40,
  1487.     ")",    41,
  1488.     "UP",    316,
  1489.     "IF",    317,
  1490.     "THEN",    318,
  1491.     "ELSE",    319,
  1492.     "FI",    320,
  1493.     "ELSIF",    321,
  1494.     "ILLEGAL_TOKEN",    322,
  1495.     "NUM",    323,
  1496.     "PRED",    324,
  1497.     "SUCC",    325,
  1498.     "ABS",    326,
  1499.     "CARD",    327,
  1500.     "MAX_TOKEN",    328,
  1501.     "MIN_TOKEN",    329,
  1502.     "SIZE",    330,
  1503.     "UPPER",    331,
  1504.     "LOWER",    332,
  1505.     "LENGTH",    333,
  1506.     "GDB_REGNAME",    334,
  1507.     "GDB_LAST",    335,
  1508.     "GDB_VARIABLE",    336,
  1509.     "GDB_ASSIGNMENT",    337,
  1510.     "-unknown-",    -1    /* ends search */
  1511. };
  1512.  
  1513. char * yyreds[] =
  1514. {
  1515.     "-no such reduction-",
  1516.     "start : value",
  1517.     "start : mode_name",
  1518.     "value : expression",
  1519.     "value : undefined_value",
  1520.     "undefined_value : FIXME_01",
  1521.     "location : access_name",
  1522.     "location : primitive_value POINTER",
  1523.     "access_name : LOCATION_NAME",
  1524.     "access_name : GDB_LAST",
  1525.     "access_name : GDB_REGNAME",
  1526.     "access_name : GDB_VARIABLE",
  1527.     "access_name : FIXME_03",
  1528.     "expression_list : expression",
  1529.     "expression_list : expression_list ',' expression",
  1530.     "primitive_value : location_contents",
  1531.     "primitive_value : value_name",
  1532.     "primitive_value : literal",
  1533.     "primitive_value : tuple",
  1534.     "primitive_value : value_string_element",
  1535.     "primitive_value : value_string_slice",
  1536.     "primitive_value : value_array_element",
  1537.     "primitive_value : value_array_slice",
  1538.     "primitive_value : value_structure_field",
  1539.     "primitive_value : expression_conversion",
  1540.     "primitive_value : value_procedure_call",
  1541.     "primitive_value : value_built_in_routine_call",
  1542.     "primitive_value : start_expression",
  1543.     "primitive_value : zero_adic_operator",
  1544.     "primitive_value : parenthesised_expression",
  1545.     "location_contents : location",
  1546.     "value_name : synonym_name",
  1547.     "value_name : value_enumeration_name",
  1548.     "value_name : value_do_with_name",
  1549.     "value_name : value_receive_name",
  1550.     "value_name : GENERAL_PROCEDURE_NAME",
  1551.     "literal : INTEGER_LITERAL",
  1552.     "literal : BOOLEAN_LITERAL",
  1553.     "literal : CHARACTER_LITERAL",
  1554.     "literal : FLOAT_LITERAL",
  1555.     "literal : SET_LITERAL",
  1556.     "literal : EMPTINESS_LITERAL",
  1557.     "literal : CHARACTER_STRING_LITERAL",
  1558.     "literal : BIT_STRING_LITERAL",
  1559.     "tuple : FIXME_04",
  1560.     "value_string_element : string_primitive_value '(' start_element ')'",
  1561.     "value_string_slice : string_primitive_value '(' left_element ':' right_element ')'",
  1562.     "value_string_slice : string_primitive_value '(' start_element UP slice_size ')'",
  1563.     "value_array_element : array_primitive_value '('",
  1564.     "value_array_element : array_primitive_value '(' expression_list ')'",
  1565.     "value_array_slice : array_primitive_value '(' lower_element ':' upper_element ')'",
  1566.     "value_array_slice : array_primitive_value '(' first_element UP slice_size ')'",
  1567.     "value_structure_field : primitive_value FIELD_NAME",
  1568.     "expression_conversion : mode_name parenthesised_expression",
  1569.     "value_procedure_call : FIXME_05",
  1570.     "value_built_in_routine_call : chill_value_built_in_routine_call",
  1571.     "start_expression : FIXME_06",
  1572.     "zero_adic_operator : FIXME_07",
  1573.     "parenthesised_expression : '(' expression ')'",
  1574.     "expression : operand_0",
  1575.     "expression : single_assignment_action",
  1576.     "expression : conditional_expression",
  1577.     "conditional_expression : IF boolean_expression then_alternative else_alternative FI",
  1578.     "conditional_expression : CASE case_selector_list OF value_case_alternative '[' ELSE sub_expression ']' ESAC",
  1579.     "then_alternative : THEN subexpression",
  1580.     "else_alternative : ELSE subexpression",
  1581.     "else_alternative : ELSIF boolean_expression then_alternative else_alternative",
  1582.     "sub_expression : expression",
  1583.     "value_case_alternative : case_label_specification ':' sub_expression ';'",
  1584.     "operand_0 : operand_1",
  1585.     "operand_0 : operand_0 LOGIOR operand_1",
  1586.     "operand_0 : operand_0 ORIF operand_1",
  1587.     "operand_0 : operand_0 LOGXOR operand_1",
  1588.     "operand_1 : operand_2",
  1589.     "operand_1 : operand_1 LOGAND operand_2",
  1590.     "operand_1 : operand_1 ANDIF operand_2",
  1591.     "operand_2 : operand_3",
  1592.     "operand_2 : operand_2 '=' operand_3",
  1593.     "operand_2 : operand_2 NOTEQUAL operand_3",
  1594.     "operand_2 : operand_2 '>' operand_3",
  1595.     "operand_2 : operand_2 GTR operand_3",
  1596.     "operand_2 : operand_2 '<' operand_3",
  1597.     "operand_2 : operand_2 LEQ operand_3",
  1598.     "operand_2 : operand_2 IN operand_3",
  1599.     "operand_3 : operand_4",
  1600.     "operand_3 : operand_3 '+' operand_4",
  1601.     "operand_3 : operand_3 '-' operand_4",
  1602.     "operand_3 : operand_3 SLASH_SLASH operand_4",
  1603.     "operand_4 : operand_5",
  1604.     "operand_4 : operand_4 '*' operand_5",
  1605.     "operand_4 : operand_4 '/' operand_5",
  1606.     "operand_4 : operand_4 MOD operand_5",
  1607.     "operand_4 : operand_4 REM operand_5",
  1608.     "operand_5 : operand_6",
  1609.     "operand_5 : '-' operand_6",
  1610.     "operand_5 : NOT operand_6",
  1611.     "operand_5 : parenthesised_expression literal",
  1612.     "operand_6 : POINTER location",
  1613.     "operand_6 : RECEIVE buffer_location",
  1614.     "operand_6 : primitive_value",
  1615.     "single_assignment_action : location GDB_ASSIGNMENT value",
  1616.     "chill_value_built_in_routine_call : NUM '(' expression ')'",
  1617.     "chill_value_built_in_routine_call : PRED '(' expression ')'",
  1618.     "chill_value_built_in_routine_call : SUCC '(' expression ')'",
  1619.     "chill_value_built_in_routine_call : ABS '(' expression ')'",
  1620.     "chill_value_built_in_routine_call : CARD '(' expression ')'",
  1621.     "chill_value_built_in_routine_call : MAX_TOKEN '(' expression ')'",
  1622.     "chill_value_built_in_routine_call : MIN_TOKEN '(' expression ')'",
  1623.     "chill_value_built_in_routine_call : SIZE '(' location ')'",
  1624.     "chill_value_built_in_routine_call : SIZE '(' mode_argument ')'",
  1625.     "chill_value_built_in_routine_call : UPPER '(' upper_lower_argument ')'",
  1626.     "chill_value_built_in_routine_call : LOWER '(' upper_lower_argument ')'",
  1627.     "chill_value_built_in_routine_call : LENGTH '(' length_argument ')'",
  1628.     "mode_argument : mode_name",
  1629.     "mode_argument : array_mode_name '(' expression ')'",
  1630.     "mode_argument : string_mode_name '(' expression ')'",
  1631.     "mode_argument : variant_structure_mode_name '(' expression_list ')'",
  1632.     "mode_name : TYPENAME",
  1633.     "upper_lower_argument : expression",
  1634.     "upper_lower_argument : mode_name",
  1635.     "length_argument : expression",
  1636.     "array_primitive_value : primitive_value",
  1637.     "array_mode_name : FIXME_08",
  1638.     "string_mode_name : FIXME_09",
  1639.     "variant_structure_mode_name : FIXME_10",
  1640.     "synonym_name : FIXME_11",
  1641.     "value_enumeration_name : FIXME_12",
  1642.     "value_do_with_name : FIXME_13",
  1643.     "value_receive_name : FIXME_14",
  1644.     "string_primitive_value : FIXME_15",
  1645.     "start_element : FIXME_16",
  1646.     "left_element : FIXME_17",
  1647.     "right_element : FIXME_18",
  1648.     "slice_size : FIXME_19",
  1649.     "lower_element : FIXME_20",
  1650.     "upper_element : FIXME_21",
  1651.     "first_element : FIXME_22",
  1652.     "boolean_expression : FIXME_26",
  1653.     "case_selector_list : FIXME_27",
  1654.     "subexpression : FIXME_28",
  1655.     "case_label_specification : FIXME_29",
  1656.     "buffer_location : FIXME_30",
  1657. };
  1658. #endif /* YYDEBUG */
  1659. #line 1 "/usr/lib/yaccpar"
  1660. /*    @(#)yaccpar 1.10 89/04/04 SMI; from S5R3 1.10    */
  1661.  
  1662. /*
  1663. ** Skeleton parser driver for yacc output
  1664. */
  1665.  
  1666. /*
  1667. ** yacc user known macros and defines
  1668. */
  1669. #define YYERROR        goto yyerrlab
  1670. #define YYACCEPT    { free(yys); free(yyv); return(0); }
  1671. #define YYABORT        { free(yys); free(yyv); return(1); }
  1672. #define YYBACKUP( newtoken, newvalue )\
  1673. {\
  1674.     if ( yychar >= 0 || ( yyr2[ yytmp ] >> 1 ) != 1 )\
  1675.     {\
  1676.         yyerror( "syntax error - cannot backup" );\
  1677.         goto yyerrlab;\
  1678.     }\
  1679.     yychar = newtoken;\
  1680.     yystate = *yyps;\
  1681.     yylval = newvalue;\
  1682.     goto yynewstate;\
  1683. }
  1684. #define YYRECOVERING()    (!!yyerrflag)
  1685. #ifndef YYDEBUG
  1686. #    define YYDEBUG    1    /* make debugging available */
  1687. #endif
  1688.  
  1689. /*
  1690. ** user known globals
  1691. */
  1692. int yydebug;            /* set to 1 to get debugging */
  1693.  
  1694. /*
  1695. ** driver internal defines
  1696. */
  1697. #define YYFLAG        (-1000)
  1698.  
  1699. /*
  1700. ** static variables used by the parser
  1701. */
  1702. static YYSTYPE *yyv;            /* value stack */
  1703. static int *yys;            /* state stack */
  1704.  
  1705. static YYSTYPE *yypv;            /* top of value stack */
  1706. static int *yyps;            /* top of state stack */
  1707.  
  1708. static int yystate;            /* current state */
  1709. static int yytmp;            /* extra var (lasts between blocks) */
  1710.  
  1711. int yynerrs;            /* number of errors */
  1712.  
  1713. int yyerrflag;            /* error recovery flag */
  1714. int yychar;            /* current input token number */
  1715.  
  1716.  
  1717. /*
  1718. ** yyparse - return 0 if worked, 1 if syntax error not recovered from
  1719. */
  1720. int
  1721. yyparse()
  1722. {
  1723.     register YYSTYPE *yypvt;    /* top of value stack for $vars */
  1724.     unsigned yymaxdepth = YYMAXDEPTH;
  1725.  
  1726.     /*
  1727.     ** Initialize externals - yyparse may be called more than once
  1728.     */
  1729.     yyv = (YYSTYPE*)xmalloc(yymaxdepth*sizeof(YYSTYPE));
  1730.     yys = (int*)xmalloc(yymaxdepth*sizeof(int));
  1731.     if (!yyv || !yys)
  1732.     {
  1733.         yyerror( "out of memory" );
  1734.         return(1);
  1735.     }
  1736.     yypv = &yyv[-1];
  1737.     yyps = &yys[-1];
  1738.     yystate = 0;
  1739.     yytmp = 0;
  1740.     yynerrs = 0;
  1741.     yyerrflag = 0;
  1742.     yychar = -1;
  1743.  
  1744.     goto yystack;
  1745.     {
  1746.         register YYSTYPE *yy_pv;    /* top of value stack */
  1747.         register int *yy_ps;        /* top of state stack */
  1748.         register int yy_state;        /* current state */
  1749.         register int  yy_n;        /* internal state number info */
  1750.  
  1751.         /*
  1752.         ** get globals into registers.
  1753.         ** branch to here only if YYBACKUP was called.
  1754.         */
  1755.     yynewstate:
  1756.         yy_pv = yypv;
  1757.         yy_ps = yyps;
  1758.         yy_state = yystate;
  1759.         goto yy_newstate;
  1760.  
  1761.         /*
  1762.         ** get globals into registers.
  1763.         ** either we just started, or we just finished a reduction
  1764.         */
  1765.     yystack:
  1766.         yy_pv = yypv;
  1767.         yy_ps = yyps;
  1768.         yy_state = yystate;
  1769.  
  1770.         /*
  1771.         ** top of for (;;) loop while no reductions done
  1772.         */
  1773.     yy_stack:
  1774.         /*
  1775.         ** put a state and value onto the stacks
  1776.         */
  1777. #if YYDEBUG
  1778.         /*
  1779.         ** if debugging, look up token value in list of value vs.
  1780.         ** name pairs.  0 and negative (-1) are special values.
  1781.         ** Note: linear search is used since time is not a real
  1782.         ** consideration while debugging.
  1783.         */
  1784.         if ( yydebug )
  1785.         {
  1786.             register int yy_i;
  1787.  
  1788.             (void)printf( "State %d, token ", yy_state );
  1789.             if ( yychar == 0 )
  1790.                 (void)printf( "end-of-file\n" );
  1791.             else if ( yychar < 0 )
  1792.                 (void)printf( "-none-\n" );
  1793.             else
  1794.             {
  1795.                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
  1796.                     yy_i++ )
  1797.                 {
  1798.                     if ( yytoks[yy_i].t_val == yychar )
  1799.                         break;
  1800.                 }
  1801.                 (void)printf( "%s\n", yytoks[yy_i].t_name );
  1802.             }
  1803.         }
  1804. #endif /* YYDEBUG */
  1805.         if ( ++yy_ps >= &yys[ yymaxdepth ] )    /* room on stack? */
  1806.         {
  1807.             /*
  1808.             ** xreallocate and recover.  Note that pointers
  1809.             ** have to be reset, or bad things will happen
  1810.             */
  1811.             int yyps_index = (yy_ps - yys);
  1812.             int yypv_index = (yy_pv - yyv);
  1813.             int yypvt_index = (yypvt - yyv);
  1814.             yymaxdepth += YYMAXDEPTH;
  1815.             yyv = (YYSTYPE*)xrealloc((char*)yyv,
  1816.                 yymaxdepth * sizeof(YYSTYPE));
  1817.             yys = (int*)xrealloc((char*)yys,
  1818.                 yymaxdepth * sizeof(int));
  1819.             if (!yyv || !yys)
  1820.             {
  1821.                 yyerror( "yacc stack overflow" );
  1822.                 return(1);
  1823.             }
  1824.             yy_ps = yys + yyps_index;
  1825.             yy_pv = yyv + yypv_index;
  1826.             yypvt = yyv + yypvt_index;
  1827.         }
  1828.         *yy_ps = yy_state;
  1829.         *++yy_pv = yyval;
  1830.  
  1831.         /*
  1832.         ** we have a new state - find out what to do
  1833.         */
  1834.     yy_newstate:
  1835.         if ( ( yy_n = yypact[ yy_state ] ) <= YYFLAG )
  1836.             goto yydefault;        /* simple state */
  1837. #if YYDEBUG
  1838.         /*
  1839.         ** if debugging, need to mark whether new token grabbed
  1840.         */
  1841.         yytmp = yychar < 0;
  1842. #endif
  1843.         if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
  1844.             yychar = 0;        /* reached EOF */
  1845. #if YYDEBUG
  1846.         if ( yydebug && yytmp )
  1847.         {
  1848.             register int yy_i;
  1849.  
  1850.             (void)printf( "Received token " );
  1851.             if ( yychar == 0 )
  1852.                 (void)printf( "end-of-file\n" );
  1853.             else if ( yychar < 0 )
  1854.                 (void)printf( "-none-\n" );
  1855.             else
  1856.             {
  1857.                 for ( yy_i = 0; yytoks[yy_i].t_val >= 0;
  1858.                     yy_i++ )
  1859.                 {
  1860.                     if ( yytoks[yy_i].t_val == yychar )
  1861.                         break;
  1862.                 }
  1863.                 (void)printf( "%s\n", yytoks[yy_i].t_name );
  1864.             }
  1865.         }
  1866. #endif /* YYDEBUG */
  1867.         if ( ( ( yy_n += yychar ) < 0 ) || ( yy_n >= YYLAST ) )
  1868.             goto yydefault;
  1869.         if ( yychk[ yy_n = yyact[ yy_n ] ] == yychar )    /*valid shift*/
  1870.         {
  1871.             yychar = -1;
  1872.             yyval = yylval;
  1873.             yy_state = yy_n;
  1874.             if ( yyerrflag > 0 )
  1875.                 yyerrflag--;
  1876.             goto yy_stack;
  1877.         }
  1878.  
  1879.     yydefault:
  1880.         if ( ( yy_n = yydef[ yy_state ] ) == -2 )
  1881.         {
  1882. #if YYDEBUG
  1883.             yytmp = yychar < 0;
  1884. #endif
  1885.             if ( ( yychar < 0 ) && ( ( yychar = yylex() ) < 0 ) )
  1886.                 yychar = 0;        /* reached EOF */
  1887. #if YYDEBUG
  1888.             if ( yydebug && yytmp )
  1889.             {
  1890.                 register int yy_i;
  1891.  
  1892.                 (void)printf( "Received token " );
  1893.                 if ( yychar == 0 )
  1894.                     (void)printf( "end-of-file\n" );
  1895.                 else if ( yychar < 0 )
  1896.                     (void)printf( "-none-\n" );
  1897.                 else
  1898.                 {
  1899.                     for ( yy_i = 0;
  1900.                         yytoks[yy_i].t_val >= 0;
  1901.                         yy_i++ )
  1902.                     {
  1903.                         if ( yytoks[yy_i].t_val
  1904.                             == yychar )
  1905.                         {
  1906.                             break;
  1907.                         }
  1908.                     }
  1909.                     (void)printf( "%s\n", yytoks[yy_i].t_name );
  1910.                 }
  1911.             }
  1912. #endif /* YYDEBUG */
  1913.             /*
  1914.             ** look through exception table
  1915.             */
  1916.             {
  1917.                 register int *yyxi = yyexca;
  1918.  
  1919.                 while ( ( *yyxi != -1 ) ||
  1920.                     ( yyxi[1] != yy_state ) )
  1921.                 {
  1922.                     yyxi += 2;
  1923.                 }
  1924.                 while ( ( *(yyxi += 2) >= 0 ) &&
  1925.                     ( *yyxi != yychar ) )
  1926.                     ;
  1927.                 if ( ( yy_n = yyxi[1] ) < 0 )
  1928.                     YYACCEPT;
  1929.             }
  1930.         }
  1931.  
  1932.         /*
  1933.         ** check for syntax error
  1934.         */
  1935.         if ( yy_n == 0 )    /* have an error */
  1936.         {
  1937.             /* no worry about speed here! */
  1938.             switch ( yyerrflag )
  1939.             {
  1940.             case 0:        /* new error */
  1941.                 yyerror( "syntax error" );
  1942.                 goto skip_init;
  1943.             yyerrlab:
  1944.                 /*
  1945.                 ** get globals into registers.
  1946.                 ** we have a user generated syntax type error
  1947.                 */
  1948.                 yy_pv = yypv;
  1949.                 yy_ps = yyps;
  1950.                 yy_state = yystate;
  1951.                 yynerrs++;
  1952.             skip_init:
  1953.             case 1:
  1954.             case 2:        /* incompletely recovered error */
  1955.                     /* try again... */
  1956.                 yyerrflag = 3;
  1957.                 /*
  1958.                 ** find state where "error" is a legal
  1959.                 ** shift action
  1960.                 */
  1961.                 while ( yy_ps >= yys )
  1962.                 {
  1963.                     yy_n = yypact[ *yy_ps ] + YYERRCODE;
  1964.                     if ( yy_n >= 0 && yy_n < YYLAST &&
  1965.                         yychk[yyact[yy_n]] == YYERRCODE)                    {
  1966.                         /*
  1967.                         ** simulate shift of "error"
  1968.                         */
  1969.                         yy_state = yyact[ yy_n ];
  1970.                         goto yy_stack;
  1971.                     }
  1972.                     /*
  1973.                     ** current state has no shift on
  1974.                     ** "error", pop stack
  1975.                     */
  1976. #if YYDEBUG
  1977. #    define _POP_ "Error recovery pops state %d, uncovers state %d\n"
  1978.                     if ( yydebug )
  1979.                         (void)printf( _POP_, *yy_ps,
  1980.                             yy_ps[-1] );
  1981. #    undef _POP_
  1982. #endif
  1983.                     yy_ps--;
  1984.                     yy_pv--;
  1985.                 }
  1986.                 /*
  1987.                 ** there is no state on stack with "error" as
  1988.                 ** a valid shift.  give up.
  1989.                 */
  1990.                 YYABORT;
  1991.             case 3:        /* no shift yet; eat a token */
  1992. #if YYDEBUG
  1993.                 /*
  1994.                 ** if debugging, look up token in list of
  1995.                 ** pairs.  0 and negative shouldn't occur,
  1996.                 ** but since timing doesn't matter when
  1997.                 ** debugging, it doesn't hurt to leave the
  1998.                 ** tests here.
  1999.                 */
  2000.                 if ( yydebug )
  2001.                 {
  2002.                     register int yy_i;
  2003.  
  2004.                     (void)printf( "Error recovery discards " );
  2005.                     if ( yychar == 0 )
  2006.                         (void)printf( "token end-of-file\n" );
  2007.                     else if ( yychar < 0 )
  2008.                         (void)printf( "token -none-\n" );
  2009.                     else
  2010.                     {
  2011.                         for ( yy_i = 0;
  2012.                             yytoks[yy_i].t_val >= 0;
  2013.                             yy_i++ )
  2014.                         {
  2015.                             if ( yytoks[yy_i].t_val
  2016.                                 == yychar )
  2017.                             {
  2018.                                 break;
  2019.                             }
  2020.                         }
  2021.                         (void)printf( "token %s\n",
  2022.                             yytoks[yy_i].t_name );
  2023.                     }
  2024.                 }
  2025. #endif /* YYDEBUG */
  2026.                 if ( yychar == 0 )    /* reached EOF. quit */
  2027.                     YYABORT;
  2028.                 yychar = -1;
  2029.                 goto yy_newstate;
  2030.             }
  2031.         }/* end if ( yy_n == 0 ) */
  2032.         /*
  2033.         ** reduction by production yy_n
  2034.         ** put stack tops, etc. so things right after switch
  2035.         */
  2036. #if YYDEBUG
  2037.         /*
  2038.         ** if debugging, print the string that is the user's
  2039.         ** specification of the reduction which is just about
  2040.         ** to be done.
  2041.         */
  2042.         if ( yydebug )
  2043.             (void)printf( "Reduce by (%d) \"%s\"\n",
  2044.                 yy_n, yyreds[ yy_n ] );
  2045. #endif
  2046.         yytmp = yy_n;            /* value to switch over */
  2047.         yypvt = yy_pv;            /* $vars top of value stack */
  2048.         /*
  2049.         ** Look in goto table for next state
  2050.         ** Sorry about using yy_state here as temporary
  2051.         ** register variable, but why not, if it works...
  2052.         ** If yyr2[ yy_n ] doesn't have the low order bit
  2053.         ** set, then there is no action to be done for
  2054.         ** this reduction.  So, no saving & unsaving of
  2055.         ** registers done.  The only difference between the
  2056.         ** code just after the if and the body of the if is
  2057.         ** the goto yy_stack in the body.  This way the test
  2058.         ** can be made before the choice of what to do is needed.
  2059.         */
  2060.         {
  2061.             /* length of production doubled with extra bit */
  2062.             register int yy_len = yyr2[ yy_n ];
  2063.  
  2064.             if ( !( yy_len & 01 ) )
  2065.             {
  2066.                 yy_len >>= 1;
  2067.                 yyval = ( yy_pv -= yy_len )[1];    /* $$ = $1 */
  2068.                 yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
  2069.                     *( yy_ps -= yy_len ) + 1;
  2070.                 if ( yy_state >= YYLAST ||
  2071.                     yychk[ yy_state =
  2072.                     yyact[ yy_state ] ] != -yy_n )
  2073.                 {
  2074.                     yy_state = yyact[ yypgo[ yy_n ] ];
  2075.                 }
  2076.                 goto yy_stack;
  2077.             }
  2078.             yy_len >>= 1;
  2079.             yyval = ( yy_pv -= yy_len )[1];    /* $$ = $1 */
  2080.             yy_state = yypgo[ yy_n = yyr1[ yy_n ] ] +
  2081.                 *( yy_ps -= yy_len ) + 1;
  2082.             if ( yy_state >= YYLAST ||
  2083.                 yychk[ yy_state = yyact[ yy_state ] ] != -yy_n )
  2084.             {
  2085.                 yy_state = yyact[ yypgo[ yy_n ] ];
  2086.             }
  2087.         }
  2088.                     /* save until reenter driver code */
  2089.         yystate = yy_state;
  2090.         yyps = yy_ps;
  2091.         yypv = yy_pv;
  2092.     }
  2093.     /*
  2094.     ** code supplied by user is placed in this switch
  2095.     */
  2096.     switch( yytmp )
  2097.     {
  2098.         
  2099. case 1:
  2100. # line 315 "./ch-exp.y"
  2101. { } break;
  2102. case 2:
  2103. # line 317 "./ch-exp.y"
  2104. { write_exp_elt_opcode(OP_TYPE);
  2105.               write_exp_elt_type(yypvt[-0].tsym.type);
  2106.               write_exp_elt_opcode(OP_TYPE);} break;
  2107. case 3:
  2108. # line 323 "./ch-exp.y"
  2109. {
  2110.               yyval.voidval = 0;    /* FIXME */
  2111.             } break;
  2112. case 4:
  2113. # line 327 "./ch-exp.y"
  2114. {
  2115.               yyval.voidval = 0;    /* FIXME */
  2116.             } break;
  2117. case 5:
  2118. # line 333 "./ch-exp.y"
  2119. {
  2120.               yyval.voidval = 0;    /* FIXME */
  2121.             } break;
  2122. case 7:
  2123. # line 342 "./ch-exp.y"
  2124. {
  2125.               write_exp_elt_opcode (UNOP_IND);
  2126.             } break;
  2127. case 8:
  2128. # line 350 "./ch-exp.y"
  2129. {
  2130.               write_exp_elt_opcode (OP_VAR_VALUE);
  2131.               write_exp_elt_block (NULL);
  2132.               write_exp_elt_sym (yypvt[-0].ssym.sym);
  2133.               write_exp_elt_opcode (OP_VAR_VALUE);
  2134.             } break;
  2135. case 9:
  2136. # line 357 "./ch-exp.y"
  2137. {
  2138.               write_exp_elt_opcode (OP_LAST);
  2139.               write_exp_elt_longcst (yypvt[-0].lval);
  2140.               write_exp_elt_opcode (OP_LAST); 
  2141.             } break;
  2142. case 10:
  2143. # line 363 "./ch-exp.y"
  2144. {
  2145.               write_exp_elt_opcode (OP_REGISTER);
  2146.               write_exp_elt_longcst (yypvt[-0].lval);
  2147.               write_exp_elt_opcode (OP_REGISTER); 
  2148.             } break;
  2149. case 11:
  2150. # line 369 "./ch-exp.y"
  2151. {
  2152.               write_exp_elt_opcode (OP_INTERNALVAR);
  2153.               write_exp_elt_intern (yypvt[-0].ivar);
  2154.               write_exp_elt_opcode (OP_INTERNALVAR); 
  2155.             } break;
  2156. case 12:
  2157. # line 375 "./ch-exp.y"
  2158. {
  2159.               yyval.voidval = 0;    /* FIXME */
  2160.             } break;
  2161. case 13:
  2162. # line 383 "./ch-exp.y"
  2163. {
  2164.               arglist_len = 1;
  2165.             } break;
  2166. case 14:
  2167. # line 387 "./ch-exp.y"
  2168. {
  2169.               arglist_len++;
  2170.             } break;
  2171. case 15:
  2172. # line 394 "./ch-exp.y"
  2173. {
  2174.               yyval.voidval = 0;    /* FIXME */
  2175.             } break;
  2176. case 16:
  2177. # line 398 "./ch-exp.y"
  2178. {
  2179.               yyval.voidval = 0;    /* FIXME */
  2180.             } break;
  2181. case 17:
  2182. # line 402 "./ch-exp.y"
  2183. {
  2184.               yyval.voidval = 0;    /* FIXME */
  2185.             } break;
  2186. case 18:
  2187. # line 406 "./ch-exp.y"
  2188. {
  2189.               yyval.voidval = 0;    /* FIXME */
  2190.             } break;
  2191. case 19:
  2192. # line 410 "./ch-exp.y"
  2193. {
  2194.               yyval.voidval = 0;    /* FIXME */
  2195.             } break;
  2196. case 20:
  2197. # line 414 "./ch-exp.y"
  2198. {
  2199.               yyval.voidval = 0;    /* FIXME */
  2200.             } break;
  2201. case 21:
  2202. # line 418 "./ch-exp.y"
  2203. {
  2204.               yyval.voidval = 0;    /* FIXME */
  2205.             } break;
  2206. case 22:
  2207. # line 422 "./ch-exp.y"
  2208. {
  2209.               yyval.voidval = 0;    /* FIXME */
  2210.             } break;
  2211. case 23:
  2212. # line 426 "./ch-exp.y"
  2213. {
  2214.               yyval.voidval = 0;    /* FIXME */
  2215.             } break;
  2216. case 24:
  2217. # line 430 "./ch-exp.y"
  2218. {
  2219.               yyval.voidval = 0;    /* FIXME */
  2220.             } break;
  2221. case 25:
  2222. # line 434 "./ch-exp.y"
  2223. {
  2224.               yyval.voidval = 0;    /* FIXME */
  2225.             } break;
  2226. case 26:
  2227. # line 438 "./ch-exp.y"
  2228. {
  2229.               yyval.voidval = 0;    /* FIXME */
  2230.             } break;
  2231. case 27:
  2232. # line 442 "./ch-exp.y"
  2233. {
  2234.               yyval.voidval = 0;    /* FIXME */
  2235.             } break;
  2236. case 28:
  2237. # line 446 "./ch-exp.y"
  2238. {
  2239.               yyval.voidval = 0;    /* FIXME */
  2240.             } break;
  2241. case 29:
  2242. # line 450 "./ch-exp.y"
  2243. {
  2244.               yyval.voidval = 0;    /* FIXME */
  2245.             } break;
  2246. case 30:
  2247. # line 458 "./ch-exp.y"
  2248. {
  2249.               yyval.voidval = 0;    /* FIXME */
  2250.             } break;
  2251. case 31:
  2252. # line 466 "./ch-exp.y"
  2253. {
  2254.               yyval.voidval = 0;    /* FIXME */
  2255.             } break;
  2256. case 32:
  2257. # line 470 "./ch-exp.y"
  2258. {
  2259.               yyval.voidval = 0;    /* FIXME */
  2260.             } break;
  2261. case 33:
  2262. # line 474 "./ch-exp.y"
  2263. {
  2264.               yyval.voidval = 0;    /* FIXME */
  2265.             } break;
  2266. case 34:
  2267. # line 478 "./ch-exp.y"
  2268. {
  2269.               yyval.voidval = 0;    /* FIXME */
  2270.             } break;
  2271. case 35:
  2272. # line 482 "./ch-exp.y"
  2273. {
  2274.               write_exp_elt_opcode (OP_VAR_VALUE);
  2275.               write_exp_elt_block (NULL);
  2276.               write_exp_elt_sym (yypvt[-0].ssym.sym);
  2277.               write_exp_elt_opcode (OP_VAR_VALUE);
  2278.             } break;
  2279. case 36:
  2280. # line 493 "./ch-exp.y"
  2281. {
  2282.               write_exp_elt_opcode (OP_LONG);
  2283.               write_exp_elt_type (yypvt[-0].typed_val.type);
  2284.               write_exp_elt_longcst ((LONGEST) (yypvt[-0].typed_val.val));
  2285.               write_exp_elt_opcode (OP_LONG);
  2286.             } break;
  2287. case 37:
  2288. # line 500 "./ch-exp.y"
  2289. {
  2290.               write_exp_elt_opcode (OP_BOOL);
  2291.               write_exp_elt_longcst ((LONGEST) yypvt[-0].ulval);
  2292.               write_exp_elt_opcode (OP_BOOL);
  2293.             } break;
  2294. case 38:
  2295. # line 506 "./ch-exp.y"
  2296. {
  2297.               write_exp_elt_opcode (OP_LONG);
  2298.               write_exp_elt_type (yypvt[-0].typed_val.type);
  2299.               write_exp_elt_longcst ((LONGEST) (yypvt[-0].typed_val.val));
  2300.               write_exp_elt_opcode (OP_LONG);
  2301.             } break;
  2302. case 39:
  2303. # line 513 "./ch-exp.y"
  2304. {
  2305.               write_exp_elt_opcode (OP_DOUBLE);
  2306.               write_exp_elt_type (builtin_type_double);
  2307.               write_exp_elt_dblcst (yypvt[-0].dval);
  2308.               write_exp_elt_opcode (OP_DOUBLE);
  2309.             } break;
  2310. case 40:
  2311. # line 520 "./ch-exp.y"
  2312. {
  2313.               yyval.voidval = 0;    /* FIXME */
  2314.             } break;
  2315. case 41:
  2316. # line 524 "./ch-exp.y"
  2317. {
  2318.               yyval.voidval = 0;    /* FIXME */
  2319.             } break;
  2320. case 42:
  2321. # line 528 "./ch-exp.y"
  2322. {
  2323.               write_exp_elt_opcode (OP_STRING);
  2324.               write_exp_string (yypvt[-0].sval);
  2325.               write_exp_elt_opcode (OP_STRING);
  2326.             } break;
  2327. case 43:
  2328. # line 534 "./ch-exp.y"
  2329. {
  2330.               write_exp_elt_opcode (OP_BITSTRING);
  2331.               write_exp_bitstring (yypvt[-0].sval);
  2332.               write_exp_elt_opcode (OP_BITSTRING);
  2333.             } break;
  2334. case 44:
  2335. # line 544 "./ch-exp.y"
  2336. {
  2337.               yyval.voidval = 0;    /* FIXME */
  2338.             } break;
  2339. case 45:
  2340. # line 553 "./ch-exp.y"
  2341. {
  2342.               yyval.voidval = 0;    /* FIXME */
  2343.             } break;
  2344. case 46:
  2345. # line 561 "./ch-exp.y"
  2346. {
  2347.               yyval.voidval = 0;    /* FIXME */
  2348.             } break;
  2349. case 47:
  2350. # line 565 "./ch-exp.y"
  2351. {
  2352.               yyval.voidval = 0;    /* FIXME */
  2353.             } break;
  2354. case 48:
  2355. # line 575 "./ch-exp.y"
  2356. { start_arglist (); } break;
  2357. case 49:
  2358. # line 577 "./ch-exp.y"
  2359. {
  2360.               write_exp_elt_opcode (MULTI_SUBSCRIPT);
  2361.               write_exp_elt_longcst ((LONGEST) end_arglist ());
  2362.               write_exp_elt_opcode (MULTI_SUBSCRIPT);
  2363.             } break;
  2364. case 50:
  2365. # line 587 "./ch-exp.y"
  2366. {
  2367.               yyval.voidval = 0;    /* FIXME */
  2368.             } break;
  2369. case 51:
  2370. # line 591 "./ch-exp.y"
  2371. {
  2372.               yyval.voidval = 0;    /* FIXME */
  2373.             } break;
  2374. case 52:
  2375. # line 599 "./ch-exp.y"
  2376. { write_exp_elt_opcode (STRUCTOP_STRUCT);
  2377.               write_exp_string (yypvt[-0].sval);
  2378.               write_exp_elt_opcode (STRUCTOP_STRUCT);
  2379.             } break;
  2380. case 53:
  2381. # line 608 "./ch-exp.y"
  2382. {
  2383.               write_exp_elt_opcode (UNOP_CAST);
  2384.               write_exp_elt_type (yypvt[-1].tsym.type);
  2385.               write_exp_elt_opcode (UNOP_CAST);
  2386.             } break;
  2387. case 54:
  2388. # line 618 "./ch-exp.y"
  2389. {
  2390.               yyval.voidval = 0;    /* FIXME */
  2391.             } break;
  2392. case 55:
  2393. # line 626 "./ch-exp.y"
  2394. {
  2395.               yyval.voidval = 0;    /* FIXME */
  2396.             } break;
  2397. case 56:
  2398. # line 634 "./ch-exp.y"
  2399. {
  2400.               yyval.voidval = 0;    /* FIXME */
  2401.             } break;
  2402. case 57:
  2403. # line 642 "./ch-exp.y"
  2404. {
  2405.               yyval.voidval = 0;    /* FIXME */
  2406.             } break;
  2407. case 58:
  2408. # line 650 "./ch-exp.y"
  2409. {
  2410.               yyval.voidval = 0;    /* FIXME */
  2411.             } break;
  2412. case 59:
  2413. # line 658 "./ch-exp.y"
  2414. {
  2415.               yyval.voidval = 0;    /* FIXME */
  2416.             } break;
  2417. case 60:
  2418. # line 662 "./ch-exp.y"
  2419. {
  2420.               yyval.voidval = 0;    /* FIXME */
  2421.             } break;
  2422. case 61:
  2423. # line 666 "./ch-exp.y"
  2424. {
  2425.               yyval.voidval = 0;    /* FIXME */
  2426.             } break;
  2427. case 62:
  2428. # line 672 "./ch-exp.y"
  2429. {
  2430.               yyval.voidval = 0;    /* FIXME */
  2431.             } break;
  2432. case 63:
  2433. # line 676 "./ch-exp.y"
  2434. {
  2435.               yyval.voidval = 0;    /* FIXME */
  2436.             } break;
  2437. case 64:
  2438. # line 682 "./ch-exp.y"
  2439. {
  2440.               yyval.voidval = 0;    /* FIXME */
  2441.             } break;
  2442. case 65:
  2443. # line 688 "./ch-exp.y"
  2444. {
  2445.               yyval.voidval = 0;    /* FIXME */
  2446.             } break;
  2447. case 66:
  2448. # line 692 "./ch-exp.y"
  2449. {
  2450.               yyval.voidval = 0;    /* FIXME */
  2451.             } break;
  2452. case 67:
  2453. # line 698 "./ch-exp.y"
  2454. {
  2455.               yyval.voidval = 0;    /* FIXME */
  2456.             } break;
  2457. case 68:
  2458. # line 704 "./ch-exp.y"
  2459. {
  2460.               yyval.voidval = 0;    /* FIXME */
  2461.             } break;
  2462. case 69:
  2463. # line 712 "./ch-exp.y"
  2464. {
  2465.               yyval.voidval = 0;    /* FIXME */
  2466.             } break;
  2467. case 70:
  2468. # line 716 "./ch-exp.y"
  2469. {
  2470.               write_exp_elt_opcode (BINOP_BITWISE_IOR);
  2471.             } break;
  2472. case 71:
  2473. # line 720 "./ch-exp.y"
  2474. {
  2475.               yyval.voidval = 0;    /* FIXME */
  2476.             } break;
  2477. case 72:
  2478. # line 724 "./ch-exp.y"
  2479. {
  2480.               write_exp_elt_opcode (BINOP_BITWISE_XOR);
  2481.             } break;
  2482. case 73:
  2483. # line 732 "./ch-exp.y"
  2484. {
  2485.               yyval.voidval = 0;    /* FIXME */
  2486.             } break;
  2487. case 74:
  2488. # line 736 "./ch-exp.y"
  2489. {
  2490.               write_exp_elt_opcode (BINOP_BITWISE_AND);
  2491.             } break;
  2492. case 75:
  2493. # line 740 "./ch-exp.y"
  2494. {
  2495.               yyval.voidval = 0;    /* FIXME */
  2496.             } break;
  2497. case 76:
  2498. # line 748 "./ch-exp.y"
  2499. {
  2500.               yyval.voidval = 0;    /* FIXME */
  2501.             } break;
  2502. case 77:
  2503. # line 752 "./ch-exp.y"
  2504. {
  2505.               write_exp_elt_opcode (BINOP_EQUAL);
  2506.             } break;
  2507. case 78:
  2508. # line 756 "./ch-exp.y"
  2509. {
  2510.               write_exp_elt_opcode (BINOP_NOTEQUAL);
  2511.             } break;
  2512. case 79:
  2513. # line 760 "./ch-exp.y"
  2514. {
  2515.               write_exp_elt_opcode (BINOP_GTR);
  2516.             } break;
  2517. case 80:
  2518. # line 764 "./ch-exp.y"
  2519. {
  2520.               write_exp_elt_opcode (BINOP_GEQ);
  2521.             } break;
  2522. case 81:
  2523. # line 768 "./ch-exp.y"
  2524. {
  2525.               write_exp_elt_opcode (BINOP_LESS);
  2526.             } break;
  2527. case 82:
  2528. # line 772 "./ch-exp.y"
  2529. {
  2530.               write_exp_elt_opcode (BINOP_LEQ);
  2531.             } break;
  2532. case 83:
  2533. # line 776 "./ch-exp.y"
  2534. {
  2535.               write_exp_elt_opcode (BINOP_IN);
  2536.             } break;
  2537. case 84:
  2538. # line 785 "./ch-exp.y"
  2539. {
  2540.               yyval.voidval = 0;    /* FIXME */
  2541.             } break;
  2542. case 85:
  2543. # line 789 "./ch-exp.y"
  2544. {
  2545.               write_exp_elt_opcode (BINOP_ADD);
  2546.             } break;
  2547. case 86:
  2548. # line 793 "./ch-exp.y"
  2549. {
  2550.               write_exp_elt_opcode (BINOP_SUB);
  2551.             } break;
  2552. case 87:
  2553. # line 797 "./ch-exp.y"
  2554. {
  2555.               write_exp_elt_opcode (BINOP_CONCAT);
  2556.             } break;
  2557. case 88:
  2558. # line 805 "./ch-exp.y"
  2559. {
  2560.               yyval.voidval = 0;    /* FIXME */
  2561.             } break;
  2562. case 89:
  2563. # line 809 "./ch-exp.y"
  2564. {
  2565.               write_exp_elt_opcode (BINOP_MUL);
  2566.             } break;
  2567. case 90:
  2568. # line 813 "./ch-exp.y"
  2569. {
  2570.               write_exp_elt_opcode (BINOP_DIV);
  2571.             } break;
  2572. case 91:
  2573. # line 817 "./ch-exp.y"
  2574. {
  2575.               write_exp_elt_opcode (BINOP_MOD);
  2576.             } break;
  2577. case 92:
  2578. # line 821 "./ch-exp.y"
  2579. {
  2580.               write_exp_elt_opcode (BINOP_REM);
  2581.             } break;
  2582. case 93:
  2583. # line 829 "./ch-exp.y"
  2584. {
  2585.               yyval.voidval = 0;    /* FIXME */
  2586.             } break;
  2587. case 94:
  2588. # line 833 "./ch-exp.y"
  2589. {
  2590.               write_exp_elt_opcode (UNOP_NEG);
  2591.             } break;
  2592. case 95:
  2593. # line 837 "./ch-exp.y"
  2594. {
  2595.               write_exp_elt_opcode (UNOP_LOGICAL_NOT);
  2596.             } break;
  2597. case 96:
  2598. # line 843 "./ch-exp.y"
  2599. {
  2600.               write_exp_elt_opcode (BINOP_CONCAT);
  2601.             } break;
  2602. case 97:
  2603. # line 851 "./ch-exp.y"
  2604. {
  2605.               write_exp_elt_opcode (UNOP_ADDR);
  2606.             } break;
  2607. case 98:
  2608. # line 855 "./ch-exp.y"
  2609. {
  2610.               yyval.voidval = 0;    /* FIXME */
  2611.             } break;
  2612. case 99:
  2613. # line 859 "./ch-exp.y"
  2614. {
  2615.               yyval.voidval = 0;    /* FIXME */
  2616.             } break;
  2617. case 100:
  2618. # line 869 "./ch-exp.y"
  2619. {
  2620.               write_exp_elt_opcode (BINOP_ASSIGN);
  2621.             } break;
  2622. case 101:
  2623. # line 878 "./ch-exp.y"
  2624. {
  2625.               yyval.voidval = 0;    /* FIXME */
  2626.             } break;
  2627. case 102:
  2628. # line 882 "./ch-exp.y"
  2629. {
  2630.               yyval.voidval = 0;    /* FIXME */
  2631.             } break;
  2632. case 103:
  2633. # line 886 "./ch-exp.y"
  2634. {
  2635.               yyval.voidval = 0;    /* FIXME */
  2636.             } break;
  2637. case 104:
  2638. # line 890 "./ch-exp.y"
  2639. {
  2640.               yyval.voidval = 0;    /* FIXME */
  2641.             } break;
  2642. case 105:
  2643. # line 894 "./ch-exp.y"
  2644. {
  2645.               yyval.voidval = 0;    /* FIXME */
  2646.             } break;
  2647. case 106:
  2648. # line 898 "./ch-exp.y"
  2649. {
  2650.               yyval.voidval = 0;    /* FIXME */
  2651.             } break;
  2652. case 107:
  2653. # line 902 "./ch-exp.y"
  2654. {
  2655.               yyval.voidval = 0;    /* FIXME */
  2656.             } break;
  2657. case 108:
  2658. # line 906 "./ch-exp.y"
  2659. {
  2660.               yyval.voidval = 0;    /* FIXME */
  2661.             } break;
  2662. case 109:
  2663. # line 910 "./ch-exp.y"
  2664. {
  2665.               yyval.voidval = 0;    /* FIXME */
  2666.             } break;
  2667. case 110:
  2668. # line 914 "./ch-exp.y"
  2669. {
  2670.               yyval.voidval = 0;    /* FIXME */
  2671.             } break;
  2672. case 111:
  2673. # line 918 "./ch-exp.y"
  2674. {
  2675.               yyval.voidval = 0;    /* FIXME */
  2676.             } break;
  2677. case 112:
  2678. # line 922 "./ch-exp.y"
  2679. {
  2680.               yyval.voidval = 0;    /* FIXME */
  2681.             } break;
  2682. case 113:
  2683. # line 928 "./ch-exp.y"
  2684. {
  2685.               yyval.voidval = 0;    /* FIXME */
  2686.             } break;
  2687. case 114:
  2688. # line 932 "./ch-exp.y"
  2689. {
  2690.               yyval.voidval = 0;    /* FIXME */
  2691.             } break;
  2692. case 115:
  2693. # line 936 "./ch-exp.y"
  2694. {
  2695.               yyval.voidval = 0;    /* FIXME */
  2696.             } break;
  2697. case 116:
  2698. # line 940 "./ch-exp.y"
  2699. {
  2700.               yyval.voidval = 0;    /* FIXME */
  2701.             } break;
  2702. case 118:
  2703. # line 949 "./ch-exp.y"
  2704. {
  2705.               yyval.voidval = 0;    /* FIXME */
  2706.             } break;
  2707. case 119:
  2708. # line 953 "./ch-exp.y"
  2709. {
  2710.               yyval.voidval = 0;    /* FIXME */
  2711.             } break;
  2712. case 120:
  2713. # line 959 "./ch-exp.y"
  2714. {
  2715.               yyval.voidval = 0;    /* FIXME */
  2716.             } break;
  2717. case 121:
  2718. # line 967 "./ch-exp.y"
  2719. {
  2720.               yyval.voidval = 0;
  2721.             } break;
  2722. case 122:
  2723. # line 975 "./ch-exp.y"
  2724. { yyval.voidval = 0; } break;
  2725. case 123:
  2726. # line 976 "./ch-exp.y"
  2727. { yyval.voidval = 0; } break;
  2728. case 124:
  2729. # line 977 "./ch-exp.y"
  2730. { yyval.voidval = 0; } break;
  2731. case 125:
  2732. # line 978 "./ch-exp.y"
  2733. { yyval.voidval = 0; } break;
  2734. case 126:
  2735. # line 979 "./ch-exp.y"
  2736. { yyval.voidval = 0; } break;
  2737. case 127:
  2738. # line 980 "./ch-exp.y"
  2739. { yyval.voidval = 0; } break;
  2740. case 128:
  2741. # line 981 "./ch-exp.y"
  2742. { yyval.voidval = 0; } break;
  2743. case 129:
  2744. # line 982 "./ch-exp.y"
  2745. { yyval.voidval = 0; } break;
  2746. case 130:
  2747. # line 983 "./ch-exp.y"
  2748. { yyval.voidval = 0; } break;
  2749. case 131:
  2750. # line 984 "./ch-exp.y"
  2751. { yyval.voidval = 0; } break;
  2752. case 132:
  2753. # line 985 "./ch-exp.y"
  2754. { yyval.voidval = 0; } break;
  2755. case 133:
  2756. # line 986 "./ch-exp.y"
  2757. { yyval.voidval = 0; } break;
  2758. case 134:
  2759. # line 987 "./ch-exp.y"
  2760. { yyval.voidval = 0; } break;
  2761. case 135:
  2762. # line 988 "./ch-exp.y"
  2763. { yyval.voidval = 0; } break;
  2764. case 136:
  2765. # line 989 "./ch-exp.y"
  2766. { yyval.voidval = 0; } break;
  2767. case 137:
  2768. # line 990 "./ch-exp.y"
  2769. { yyval.voidval = 0; } break;
  2770. case 138:
  2771. # line 991 "./ch-exp.y"
  2772. { yyval.voidval = 0; } break;
  2773. case 139:
  2774. # line 992 "./ch-exp.y"
  2775. { yyval.voidval = 0; } break;
  2776. case 140:
  2777. # line 993 "./ch-exp.y"
  2778. { yyval.voidval = 0; } break;
  2779. case 141:
  2780. # line 994 "./ch-exp.y"
  2781. { yyval.voidval = 0; } break;
  2782.     }
  2783.     goto yystack;        /* reset registers in driver code */
  2784. }
  2785.